【发布时间】:2017-05-25 12:16:35
【问题描述】:
我们有 MariaDB 和 Sphinx 搜索引擎。
其中一张表有大量数据。当前的 max_doc_id 为 849826469。但有人添加了 ID 小于 max_doc_id 的行。我无法更改 ID,因为它用于外部索引,现在我们有很多相关数据。
所以这一行不会添加到索引中,但它应该。
我该怎么做?
source srcmos
{
type = mysql
sql_host = 127.0.0.1
sql_user = root
sql_pass =
sql_db = dev_db
sql_port = 3306 # optional, default is 3306
sql_query_pre = REPLACE INTO sphinx_counter SELECT 1, MAX(id) FROM mos
sql_attr_uint = campaign_id
sql_query_range = SELECT MIN(id),MAX(id) FROM mos WHERE id <= ( SELECT max_doc_id FROM sphinx_counter WHERE id=1 )
sql_range_step = 10000
sql_query = SELECT mos.id, campaign_id, body FROM mos WHERE mos.id>=$start AND mos.id<=$end
}
【问题讨论】:
-
您应该在设置中提供有关 Sphinx 索引的其他信息。
-
@hank,已更新
-
您不能将任何内容增量添加到普通的 Sphinx 索引中。只需重新索引它。
-
@hank 很伤心:))