我有一个索引'colors',其配置如下:
source colorsmain {
type = mysql
sql_host = 127.0.0.1
sql_port = 3306
sql_user = xxxx
sql_pass = xxxx
sql_db = showroom
sql_query_range = SELECT MIN(id), MAX(id) from `colors`
sql_range_step = 5000
sql_query = SELECT id, affiliateproductid, h, s, b, w FROM colors WHERE id >= $start AND id <= $end
sql_attr_uint = affiliateproductid
sql_attr_uint = h
sql_attr_uint = s
sql_attr_uint = b
sql_attr_uint = w
}
index colors {
source = colorsmain
path = /usr/local/etc/specifycolors
docinfo = extern
charset_type = utf-8
mlock = 1
preopen = 1
}
但是,当我运行索引器时,它会返回以下内容:
using config file '/usr/local/etc/sphinx.conf'...
indexing index 'colors'...
collected 335350 docs, 0.0 MB
total 335350 docs, 0 bytes
total 1.184 sec, 0 bytes/sec, 283034.47 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 4 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
奇怪的是,当我注释掉任何一个sql_attr_uint行时,它可以正常工作:
using config file '/usr/local/etc/sphinx.conf'...
indexing index 'colors'...
collected 335350 docs, 0.6 MB
sorted 0.3 Mhits, 100.0% done
total 335350 docs, 600998 bytes
total 1.428 sec, 420646 bytes/sec, 234715.82 docs/sec
total 2 reads, 0.011 sec, 4295.3 kb/call avg, 5.5 msec/call avg
total 7 writes, 0.017 sec, 2595.9 kb/call avg, 2.5 msec/call avg
我没有在sphinx文档中看到关于属性数量限制的任何内容,并且只要我不超过4个属性,所有属性似乎都在各种组合中工作。有什么建议吗?
我在Mac OS X 10.6.6上运行sphinx 0.9.9-release(r2117)
谢谢!
答案 0 :(得分:1)
有趣的是,在我最终发布SO帖子后的5分钟,我发现答案......
这是:您必须至少有一个文本列,否则sphinx将不会索引您的数据! 在此主题http://sphinxsearch.com/forum/view.html?id=2867
中讨论