views:

72

answers:

2

Hello guys,

I've got a few tables that literally only hold integers, no "words" and for some reason Sphinx is unable to hold this data in it's library. Just returns "0 bytes" errors for these indexes.

Is it possible to do this? If so, how? Below is an example from my Sphinx.conf for one that fails.

source track
{
 type     = mysql

 sql_host    = host
 sql_user    = user
 sql_pass    = pass
 sql_db     = db
 sql_port    = port

 sql_query    = SELECT id, user, time FROM track;

 sql_attr_uint   = user
 sql_attr_uint   = time

 sql_query_info   = SELECT * FROM track WHERE id=$id
}

index track
{
 source     = track
 path     = /var/lib/sphinx/track
 docinfo     = extern
 charset_type   = utf-8
 min_prefix_len   = 1
 enable_star    = 1
}
+1  A: 

You can do it but sphinx has an odd error where you must return in the query more records than you have attributes. If you alter your SQL to be:

 sql_query    = SELECT id AS docId, id, user, time FROM track;

That should work. I've seen something similar and not sure what the "official" reason is but duping the id column seemed to do the job.

Ian
A: 

Before to find "how ?" the question is "why ?"

type = mysql You use Mysql, index of mysql are very good for these indexing.

Moosh