Solr commit 策略测试

已知Solr 的Commit策略:

服务器端:

 1)AutoCommit

 2)AutoSoftCommit

客户端 Commit

本次我测试了客户端关闭Commit的情况下,服务器端Commit策略的调整,对搜索的效果

首先,关闭了客户端的Commit,使用以下命令提交:

curl 'http://localhost:8983/solr/core0/update?commit=false' -H 'Content-type:text/json' -d '[{"id":"2","name":"haier"}]'

curl 'http://localhost:8983/solr/core0/update?commit=false' -H 'Content-type:text/json' -d '[{"id":"2","name":"117go"}]'

测试结果如下表

 
测试策略描述 操作 检索结果 重启Solr后检索结果  检索命令

服务器端配置

     <autoCommit> 
       <maxTime>${solr.autoCommit.maxTime:5000}</maxTime>
       <openSearcher>false</openSearcher>
     </autoCommit>
 客户端提交操作  无法检索  可以检索(无Recovery过程)

 使用solr query:

http://localhost:8983/solr/core0?q=id:2&wt=json&indent=true

 

服务器端配置

     <autoCommit> 
       <maxTime>${solr.autoCommit.maxTime:5000}</maxTime>
       <openSearcher>true</openSearcher>
     </autoCommit>
 客户端提交操作

 无法立即检索到。

过几秒后即可检索

 可以检索(无Recovery过程)  

 使用solr query:

http://localhost:8983/solr/core0?q=id:2&wt=json&indent=true

 

服务器端配置

     <autoSoftCommit> 
       <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> 
     </autoSoftCommit>
 客户端提交操作   可以检索

 首先由Recovery过程,然后可以检索。

如果删除Transaction log,则无法检索.

 

 使用solr query:

http://localhost:8983/solr/core0?q=id:2&wt=json&indent=true

 

服务器端配置

     <autoSoftCommit> 
       <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> 
     </autoSoftCommit>
     <autoCommit> 
       <maxTime>${solr.autoCommit.maxTime:5000}</maxTime>
       <openSearcher>false</openSearcher>
     </autoCommit>
 客户端提交操作  可以检索    使用solr query:

http://localhost:8983/solr/core0?q=id:2&wt=json&indent=true

以上是Solr服务器端的Commit 策略尝试。

原文地址:https://www.cnblogs.com/lykm02/p/4056449.html