SOLR 4.4递增索引

时间:2014-01-28 17:10:34

标签: apache solr lucene tomcat6

当我开始全部导入时:

curl -X POST http://_master_host_:_port_/solr/dataimport-xml?command=full-import

它导致我们的索引以递增方式更新。所以说我们的库存数量是900,000,它将突然被消灭并且是400 - > 1000 - > ... - > 900000(逐步更新而不是等待导入完成然后换出)。

我不知道它为什么要清除我们的索引,因为之前的版本会等到导入完成后才能进行交换。我们所有的solrconfig设置是相同的,所以我不确定是什么导致这个。我缺少任何想法或事物?

1 个答案:

答案 0 :(得分:0)

找到了罪魁祸首:

 229   <!-- The default high-performance update handler -->
 230   <updateHandler class="solr.DirectUpdateHandler2">
 231     <!-- AutoCommit
 232 
 233          Perform a hard commit automatically under certain conditions.
 234          Instead of enabling autoCommit, consider using "commitWithin"
 235          when adding documents.
 236 
 237          http://wiki.apache.org/solr/UpdateXmlMessages
 238 
 239          maxDocs - Maximum number of documents to add since the last
 240                    commit before automatically triggering a new commit.
 241 
 242          maxTime - Maximum amount of time in ms that is allowed to pass
 243                    since a document was added before automaticly
 244                    triggering a new commit.
 245          openSearcher - if false, the commit causes recent index changes
 246          to be flushed to stable storage, but does not cause a new
 247          searcher to be opened to make those changes visible.
 248       -->
 249      <autoCommit>
 250        <maxTime>15000</maxTime>
 251        <openSearcher>false</openSearcher>
 252      </autoCommit>
 253 
 254     <!-- softAutoCommit is like autoCommit except it causes a
 255          'soft' commit which only ensures that changes are visible
 256          but does not ensure that data is synced to disk.  This is
 257          faster and more near-realtime friendly than a hard commit.
 258       -->
 259 
 260     <autoSoftCommit>
 261       <maxTime>1000</maxTime>
 262     </autoSoftCommit>

注释掉了autocommit和autosoftcommit部分,索引不再以递增方式更新。看来这是在solr 4中添加的一个新参数。希望这有助于将来的其他人。

编辑:它位于SolrConfig / conf / solrconfig.xml文件中。