Sphinx non-fulltext, integer only search
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
e开发者_如何学Cnable_star = 1
}
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.
Before to find "how ?" the question is "why ?"
type = mysql You use Mysql, index of mysql are very good for these indexing.
精彩评论