我一直试图让 sphinx 通过链接 2 个索引来搜索 2 个表。以下是这些索引的来源:
source gSrc
{ #General Source
type = mysql
sql_host = localhost
sql_user = (blahblahblah)
sql_pass = (blahblahblah)
sql_db = (blahblahblah)
sql_port = 3306 # optional, default is 3306
sql_ranged_throttle = 0
}
source mentionActivitySrc : gSrc
{
sql_query = \
SELECT id, author, thesis, body, created, updated \
FROM activity
sql_attr_uint = id
sql_attr_timestamp = updated
sql_query_info = SELECT * FROM activity WHERE id=$id
}
source mentionUserSrc : gSrc
{
sql_query = \
SELECT id, first, last, username, email, updated \
FROM user
sql_attr_uint = id
sql_attr_timestamp = updated
sql_query_info = SELECT * FROM user WHERE id=$id
}
以下是索引本身:
index gIndex
{ #General Index
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
charset_type = sbcs
html_strip = 0
}
index activityMentionIndex : gIndex
{
source = mentionActivitySrc
path = /var/lib/sphinxsearch/data/activityMentionIndex
}
index userMentionIndex : gIndex
{
source = mentionUserSrc
path = /var/lib/sphinxsearch/data/userMentionIndex
}
我正在使用sphinxapi.php,当我这样做时
->query('some keywords', 'activityMentionIndex userMentionIndex');
返回数组的字段索引显示它只识别了第二个索引(在这种情况下,userMentionIndex,如果我切换它们,它将识别activityMentionIndex)
谁能告诉我我可能做错了什么,或者是否可以查询 2 个不同表的 2 个索引?