选择 solr/lucene 提交策略 [英] Choosing a solr/lucene commit strategy
本文介绍了选择 solr/lucene 提交策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I have 120k db records to commit into a Solr index.
My question is: should I commit after submitting every 10k records, or only commit once after submitting all the 120k records?
Is there any difference between these two options?
解决方案
Use Solr's default auto-commit values, which I believe are quite reasonable. If not, you can adjust them to suit your needs:
<!-- autocommit pending docs if certain criteria are met. Future versions may expand the available
criteria -->
<autoCommit>
<maxDocs>10000</maxDocs> <!-- maximum uncommited docs before autocommit triggered -->
<maxTime>50000</maxTime> <!-- maximum time (in MS) after adding a doc before an autocommit is triggered -->
</autoCommit>
This means that it will commit when there are more than 10000 docs waiting to be committed, or 50s have passed since a document was added.
这篇关于选择 solr/lucene 提交策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文