选择Solr/Lucene提交策略 [英] Choosing a solr/lucene commit strategy

查看:68
本文介绍了选择Solr/Lucene提交策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有120k db记录要提交到Solr索引中.

I have 120k db records to commit into a Solr index.

我的问题是: 在提交每10k条记录后我应该提交,还是在提交所有120k条记录后才提交一次?

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?

推荐答案

使用Solr的默认自动提交值,我认为这是很合理的.如果没有,您可以根据需要进行调整:

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>

这意味着当有超过10000个文档等待提交,或者自添加文档以来已经过去了50秒钟时,它将提交.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆