SolrJ:禁用自动提交
我们有一个 Solr 实例,我们发现在 solrconfig.xml 中打开 autoCommit 实际上可以很好地满足我们的需求。但是,在某些实例和某些批处理操作中,我们希望暂时禁用自动提交。我找不到任何东西,但我想知道是否有人知道是否可以通过 SolrJ 禁用某个进程的自动提交,然后重新启用它?
We have an instance of Solr, where we've found that turning on autoCommit in the solrconfig.xml actually may serve our needs well. However there are some instances and some batch operations where we want to temporarily disable autocommit. I have not been able to find anything, but I'm wondering if anyone knew if via SolrJ you could disable autocommit for a certain process, and then re-enable it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法禁用和启用自动提交,因为它是在 solrconfig.xml 中配置的。但是,您可以在 solrconfig.xml 中将其禁用,并对那些添加命令使用 commitWithin需要自动提交。
You can't disable and enable autocommit as it's configured in solrconfig.xml. However, you can leave it disabled in solrconfig.xml and use commitWithin for those add commands that need autocommit.
回答是因为这是“solr 禁用自动提交”的第一个结果。
现在可以使用允许覆盖某些属性的新配置 API 来实现这一点在 solrconfig.xml 中设置,无需重新加载核心。
Solrj 尚未实现该新 API。
您不应禁用自动提交,请参阅这篇文章。
如果您想一次对许多文档进行批量索引,请设置 updateHandler.autoCommit.openSearcher=false 并禁用 autoSoftCommits:
您可以在 http://localhost:8983 查看覆盖的属性/solr/<核心>/config/overlay
answering because this is the first result for "solr disable autocommit".
This is now possible with the new config API that allows to override some properties set in solrconfig.xml without reloading the core.
Solrj does not implement that new API yet.
You should not disable autocommits, see this article.
If you want to do a bulk indexing of many documents at once, set
updateHandler.autoCommit.openSearcher=false
and disable autoSoftCommits:You can see the overriden properties at
http://localhost:8983/solr/<core>/config/overlay