我们有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版本。
数据源配置
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
任何帮助将不胜感激。
致以诚挚的问候。
你如何定义你的sql_query这些索引?我以为用分区引擎,你不能直接访问底层表,只有组合表。 – barryhunter 2013-03-11 13:16:03
我把我们的配置放在这里。我不能直接访问底层表,但我认为当我检查'mod(id,4)= 0'时,它访问底层分区。我认为这是因为我可以看到添加分区时的性能改进。 – 2013-03-11 13:48:43
@barryhunter感谢您的帮助。对于“Sphinx MVA中的错误查询”问题,您的其他答案对我们有很大帮助,因为我们首先尝试将范围应用于sql_attr_multi查询。 – 2013-03-11 14:33:04