2011-02-10 20 views
0

我一直在成功使用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个密钥?

回答

0

您是否使用64位索引器重建索引?

+0

我做了一个干净的构建,包括将.enable-id64传递给./configure ...是否正确?之后,是的,我完全删除了索引并从头开始运行索引器。 – royal 2011-02-10 18:14:42