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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值