我一直在成功使用Sphinx一段時間,但遇到了讓我困惑的問題......我用MySQL查詢返回Sphinx,並最近以具有表I的ID的方式遷移了我的主鍵策略索引增長大於32位(在MYSQL中,它們是bigint無符號的)。獅身人面像獲得索引點擊,但返回我廢話ID(大概32位的查詢返回的ID或什麼)..如何在Mac OS上使用Sphinx搜索服務器0.9.9獲得64位ID?
我看着它,並意識到我沒有通過--enable-id64標誌到./configure。沒問題,完全用該標誌重建獅身人面像(順便說一句,我正在運行0.9.9)。雖然沒有改變!我仍然遇到完全相同的問題。我的測試方案是非常簡單的:
MySQL的:
create table test_sphinx(id bigint unsigned primary key, text varchar(200));
insert into test_sphinx values (10102374447, 'Girls Love Justin Beiber');
insert into test_sphinx values (500, 'But Small Ids are working?');
獅身人面像的conf:
source new_proof
{
type = mysql
sql_host = 127.0.0.1
sql_user = root
sql_pass = password
sql_db = testdb
sql_port =
sql_query_pre =
sql_query_post =
sql_query = SELECT id, text FROM test_sphinx
sql_query_info = SELECT * FROM `test_sphinx` WHERE `id` = $id
sql_attr_bigint = id
}
index new_proof
{
source = new_proof
path = /usr/local/sphinx/var/data/new_proof
docinfo = extern
morphology = none
stopwords =
min_word_len = 1
charset_type = utf-8
enable_star = 1
min_prefix_len = 0
min_infix_len = 2
}
搜索:
→ search -i new_proof beiber
Sphinx 0.9.9-release (r2117)
...
index 'new_proof': query 'beiber ': returned 1 matches of 1 total in 0.000 sec
displaying matches:
1. document=1512439855, weight=1
(document not found in db)
words:
1. 'beiber': 1 documents, 1 hits
→ search -i new_proof small
Sphinx 0.9.9-release (r2117)
...
index 'new_proof': query 'small ': returned 1 matches of 1 total in 0.000 sec
displaying matches:
1. document=500, weight=1
id=500
text=But Small Ids are working?
words:
1. 'small': 1 documents, 1 hits
任何人都有一個想法,爲什麼這被打破?
在此先感謝 -Phill
編輯
啊。好的,進一步了。我沒有提到我一直在Mac OS上進行所有這些測試。看起來這可能是我的問題。我剛剛編譯64位Linux和它的偉大工程..還有一個線索,當我運行的獅身人面像命令行命令,編譯沒有采取:
我的Mac(碎)
Sphinx 0.9.9-release (r2117)
Linux機器(工作)
Sphinx 0.9.9-id64-release (r2117)
所以我想新的問題是,有什麼訣竅編譯Mac OS上的64個密鑰?
我做了一個乾淨的構建,包括將.enable-id64傳遞給./configure ...是否正確?之後,是的,我完全刪除了索引並從頭開始運行索引器。 – royal 2011-02-10 18:14:42