1
我一直在試圖讓獅身人面像通過鏈接2個索引來搜索2個表。這裏有這些指標的來源:用Sphinx查詢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個索引?