gpt4 book ai didi

php - 在 sphinx 中使用 main 和 delta 索引

转载 作者:可可西里 更新时间:2023-10-31 22:50:17 27 4
gpt4 key购买 nike

我将网站上的全文搜索切换为 sphinx。我将使用 SphinxSE 来执行搜索。

我创建了 2 个索引,如手册中所述:http://www.sphinxsearch.com/docs/manual-0.9.9.html#live-updates

它似乎有效,并在其自己的索引中索引不同的内容,但我对如何处理索引更新、合并和重建有些困惑。

我的理解是我 cron 它每 5 分钟左右运行一次“indexer delta --rotate”,这会向索引添加新的提交。然后每天一次,我会通过运行“indexer main delta --rotate”将增量索引合并到主索引中。然后大约一个月一次,我将运行“indexer --all”来重建所有索引。

我这样做对吗,还是我遗漏了什么?

最佳答案

听起来很像我为客户所做的设置。不,搜索不会在更新期间停止工作。来自 Sphinx 文档:

--rotate is used for rotating indexes. Unless you have the situation where you can take the search function offline without troubling users, you will almost certainly need to keep search running whilst indexing new documents. --rotate creates a second index, parallel to the first (in the same place, simply including .new in the filenames). Once complete, indexer notifies searchd via sending the SIGHUP signal, and searchd will attempt to rename the indexes (renaming the existing ones to include .old and renaming the .new to replace them), and then start serving from the newer files. Depending on the setting of seamless_rotate, there may be a slight delay in being able to search the newer indexes.

关于php - 在 sphinx 中使用 main 和 delta 索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3847880/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com