私はしばらくSphinxをうまく使用してきましたが、混乱する問題に遭遇しました... mysqlクエリでSphinxをバックアップし、最近、テーブルのIDを持つ方法で主キー戦略を移行しましたインデックス作成は 32 ビットを超えます (MYSQL では bigint unsigned です)。Sphinx はインデックス ヒットを取得していましたが、無意味な ID を返しました (おそらく、クエリまたは何かによって返された ID の 32 ビット)。
調べてみると、--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?');
スフィンクスの設定:
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
なぜこれが壊れているのか誰にも分かりますか?
前もって感謝します-フィル
編集
ああ。よし、さらに進んだ。このすべてのテストを Mac OS で行っているとは言いませんでした。それは私の問題かもしれません。Linuxで64ビットでコンパイルしたところ、うまく機能しました.Sphinxコマンドラインコマンドを実行すると、コンパイルに失敗したという手がかりもあります。
私のMac(壊れた)
Sphinx 0.9.9-release (r2117)
Linux ボックス (動作中)
Sphinx 0.9.9-id64-release (r2117)
それで、新しい質問は、Mac OS で 64 ビット キー用にコンパイルするための秘訣は何だと思いますか?