繁体   English   中英

SOLR 4.4递增索引

[英]SOLR 4.4 indexing incrementally

当我通过以下方式开始全面导入时:

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

这导致我们的索引不断更新。 假设我们的库存数量为900,000,则将突然消失,为400-> 1000-> ...-> 900000(增量更新而不是等待导入完成然后换出)。

我不知道为什么要清除索引,因为以前的版本会等到导入完成后才进行交换。 我们所有的solrconfig设置都相同,所以我不确定是什么原因造成的。 有什么想法或我想念的东西吗?

找到了罪魁祸首:

 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文件中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM