Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SolrJ和自动提交_Solr_Solrj_Solr4_Solrcloud - Fatal编程技术网

SolrJ和自动提交

SolrJ和自动提交,solr,solrj,solr4,solrcloud,Solr,Solrj,Solr4,Solrcloud,我正在使用SolrJ API向Solr 4.3核心添加文档,我注意到我使用的stock solrconfig中的autocommit设置为15秒,如下所示 <autoCommit> <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> <openSearcher>false</openSearcher> </autoCommit> 提前谢谢 如果定义了自动提

我正在使用SolrJ API向Solr 4.3核心添加文档,我注意到我使用的stock solrconfig中的autocommit设置为15秒,如下所示

 <autoCommit>
   <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
   <openSearcher>false</openSearcher>
 </autoCommit>

提前谢谢

如果定义了自动提交,则不需要显式提交

但是,在上面的定义中,对于(硬)提交,您将openSearcher设置为false。这意味着,Solr将提交,但不会显示更改

在示例配置中,它可以工作,因为openSearcher设置为true(或默认设置为true)时也有autoSoftCommit提交。这将使更改实际显示出来,但无需进行昂贵的硬提交


这两个部分结合在一起可以很好地帮助您快速查看结果,然后定期将所有内容保存到磁盘。但是要确保你有两个部分,或者你在上面的部分重新打开搜索程序。只执行两次中的一次将导致结果永远不会显示,除非您在其他地方也执行显式提交。

谢谢,我将停止从SolrJ执行显式提交,SolrJ文档没有提到任何关于利用自动提交的内容,所有示例都调用了solrserver.commit()这是昂贵的,对于默认的solr配置OOB是不必要的。
        httpSolrServer.add(doc1);
        httpSolrServer.commit();// Is this still needed ?