SOLR 自动提交与自动软提交 [英] SOLR autoCommit vs autoSoftCommit

查看:38
本文介绍了SOLR 自动提交与自动软提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 和 感到非常困惑.这是我的理解

I'm very confused about and . Here is what I understand

  • autoSoftCommit - 在 autoSoftCommit 之后,如果 SOLR 服务器宕机,autoSoftCommit 文档将会丢失.

  • autoSoftCommit - after a autoSoftCommit, if the the SOLR server goes down, the autoSoftCommit documents will be lost.

autoCommit - 对磁盘进行硬提交,并确保所有 autoSoftCommit 提交都写入磁盘并提交任何其他文档.

autoCommit - does a hard commit to the disk and make sure all the autoSoftCommit commits are written to disk and commits any other document.

我的以下配置似乎只适用于 autoSoftCommit.autoCommit 本身似乎没有做任何提交.有什么我想念的吗?

My following configuration seems to be only with with autoSoftCommit. autoCommit on its own does not seems to be doing any commits. Is there something I am missing ?

<updateHandler class="solr.DirectUpdateHandler2">
    <updateLog>
        <str name="dir">${solr.ulog.dir:}</str>
    </updateLog>
   <autoSoftCommit>
        <maxDocs>1000</maxDocs>
        <maxTime>1200000</maxTime>
    </autoSoftCommit>
    <autoCommit>
        <maxDocs>10000</maxDocs>
        <maxTime>120000</maxTime> 
        <openSearcher>false</openSearcher>
    </autoCommit>
</updateHandler>

为什么 autoCommit 自己工作?

why is autoCommit working on it's own ?

推荐答案

对于硬提交,您有 openSearcher=false.这意味着即使发生了提交,搜索器也没有重新启动,也看不到更改.尝试更改该设置,您将不需要软提交.

You have openSearcher=false for hard commits. Which means that even though the commit happened, the searcher has not been restarted and cannot see the changes. Try changing that setting and you will not need soft commit.

SoftCommit 确实重新打开了搜索器.因此,如果您有两个部分,软提交会显示新的更改(即使它们不是硬提交的)并且 - 按照配置 - 硬提交会将它们保存到磁盘,但不会更改可见性.

SoftCommit does reopen the searcher. So if you have both sections, soft commit shows new changes (even if they are not hard-committed) and - as configured - hard commit saves them to disk, but does not change visibility.

这允许将软提交设置为 1 秒,并使文档快速显示并且硬提交发生的频率降低.

This allows to put soft commit to 1 second and have documents show up quickly and have hard commit happen less frequently.

这篇关于SOLR 自动提交与自动软提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆