0

I've been using Sphinx successfully for a while, but just ran into an issue that's got me confused... I back Sphinx with mysql queries and recently migrated my primary key strategy in a way that had the ids of the tables I'm indexing grow larger than 32 bits (in MYSQL they're bigint unsigned). Sphinx was getting index hits, but returning me nonsense ids (presumably 32 bits of the id returned by the queries or something)..

I looked into it, and realized I hadn't passed the --enable-id64 flag to ./configure. No problem, completely rebuilt sphinx with that flag (I'm running 0.9.9 by the way). No change though! I'm still experiencing the exact same issue. My test scenario is pretty simple:

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?');

Sphinx 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
}

Searching:

→ 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

Anyone have an idea about why this is broken?

Thanks in advance -Phill

EDIT

Ah. Okay, got further. I didn't mention that I've been doing all of this testing on Mac OS. It looks like that may be my problem. I just compiled in 64 bit on linux and it works great.. There's also a clue when I run the Sphinx command line commands that the compile didn't take:

My Mac (broken)

Sphinx 0.9.9-release (r2117)

Linux box (working)

Sphinx 0.9.9-id64-release (r2117)

So I guess the new question is what's the trick to compiling for 64 bit keys on mac os?

royal
  • 530
  • 1
  • 6
  • 12

1 Answers1

0

Did you rebuild the index with 64 bits indexer?

Manticore Search
  • 1,462
  • 9
  • 9
  • I did a clean build that included passing --enable-id64 to ./configure... Is that correct? And afterward, yeah I completely deleted the indexes and ran the indexer from scratch. – royal Feb 10 '11 at 18:14