我们使用一张表中的数据构建了 4 个sphinx索引。所有索引都具有相同的源设置,只是它们采用不同的文档。我们有这样的检查mod(id, 4) = <index number>
来在索引之间分配文档和文档属性。
问题:几乎每次我们重建索引时,四个索引之一(同一个)都无法重建。其他索引从来没有这个问题,并且可以正确重建。
我们已经对文档和属性表进行了分区。例如,这是文档表的分区方式:
PARTITION BY HASH(mod(id, 4))(
PARTITION `p0` COMMENT '',
PARTITION `p1` COMMENT '',
PARTITION `p2` COMMENT '',
PARTITION `p3` COMMENT ''
);
我们认为索引器在它接收到所有文档之后但在它开始接收属性之前挂起。当我们检查 MySQL 服务器上的会话时,我们可以看到这一点。
无法重建的索引正在使用mod(id, 4) = 0
条件。
我们在 Ubuntu 64bit 12.04.02 LTS 上使用 Sphinx 2.0.4-release。
数据源配置
source ble_job_2 : ble_job
{
sql_query = select job_notice.id as id, \
body, title, source, company, \
UNIX_TIMESTAMP(insertDate) as date, \
substring(company, 1, 1) as companyletter, \
job_notice.locationCountry as country, \
location_us_state.stateName as state, \
0 as expired, \
clusterId, \
groupCity, \
groupCityAttr, \
job_notice.cityLat as citylat, \
job_notice.cityLng as citylng, \
job_notice.zipLat as ziplat, \
job_notice.zipLng as ziplng, \
feedId, job_notice.rating as rating, \
job_notice.cityId as cityid \
from job_notice \
left join location_us_state on job_notice.locationState = location_us_state.stateCode \
where job_notice.status != 'expired' \
and mod(job_notice.id, 4) = 1
sql_attr_multi = uint attr from query; \
select noticeId, attributeId as attr from job_notice_attribute where mod(noticeId, 4) = 1
} # source ble_job_2
索引配置
index ble_job_2
{
type = plain
source = ble_job_2
path = /var/lib/sphinxsearch/data/ble_job_2
docinfo = extern
mlock = 0
morphology = none
stopwords = /etc/sphinxsearch/stopwords/blockwords.txt
min_word_len = 1
charset_type = utf-8
enable_star = 0
html_strip = 0
} # index_ble_job_2
任何帮助将不胜感激。
温暖的问候。