如何知道何时完成Solr优化? [英] How to know when Solr Optimize is done?

查看:71
本文介绍了如何知道何时完成Solr优化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这段代码触发了solr optimize命令:

  $ solr-> optimize(); 

我是否有任何方法可以确定优化已经完成?



这都是因为我在我的网站上有一个管理页面,我每天必须手动优化Solr索引,但是我很难编写此代码。



目前我有一个带有提交按钮的简单表单,它会触发optimize()命令,但我必须以某种方式确认发生了优化,这是此处的问题。



你知道有什么方法可以确认Solr的优化吗?

谢谢

解决方案

Optimize命令的文档指定,默认情况下,该命令将阻塞,直到将所有更改写入磁盘并且新搜索器可用。因此,如果您保留这些默认值,那么当命令返回时,您可以考虑完成优化。请注意,根据您当前拥有的细分的数量以及您想要的数量,该命令可能会阻止很长一段时间。我已经看到优化需要花费一个小时才能完成。

I am using the Solr-php-client to communicate with Solr, via php.

This piece of code triggers the solr optimize command:

  $solr->optimize();

I wonder if there is any method to know for sure that the optimization is done?

This is all because I have an administrations page on my website where I manually once a day must optimize the Solr index, but I have difficulty writing this code.

Currently I have a simple form with a submit button which triggers the optimize() command, but I must somehow confirm that the optimize has taken place, which is the problem here.

Do you know of any method to confirm an optimization in Solr?

Thanks

解决方案

The documentation for the Optimize command specifies that, by default, the command will block until all changes are written to disk and that the new searcher is available. So if you keep those default values, when the command returns, you can consider the optimize done. Note that, depending on the number of segments you currently have and to how many you want to go down to, the command can block for a long time. I have seen optimize taking up to an hour to complete.

这篇关于如何知道何时完成Solr优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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