问题描述
我们有一个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?
推荐答案
您不能禁用和启用自动提交,因为它是在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.
这篇关于SolrJ:禁用自动提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!