如何知道何时完成Solr优化?

编程入门 行业动态 更新时间:2024-10-11 07:32:46
本文介绍了如何知道何时完成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优化?

本文发布于:2023-11-25 11:01:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629489.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Solr

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!