当我在 sphinx.conf 中指定超过 4 个属性时,Sphinx 索引器会创建一个空索引
我有一个具有以下配置的索引“颜色”:
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)
谢谢!
I have an index 'colors' with the following configuration:
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
}
When I run indexer, however, it returns the following:
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
The odd part is that when I comment out any one of the sql_attr_uint lines, it works just fine:
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
I don't see anything in the sphinx docs regarding a limit to the number of attributes, and the attributes all seem in work in various combinations as long as i don't exceed 4 of them. Any advice?
I'm running sphinx 0.9.9-release (r2117) on Mac OS X 10.6.6
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有趣的是,就在我终于发表了这篇文章 5 分钟后,我发现了答案......
这就是:你必须至少有一个文本列,否则 sphinx 不会索引你的数据!
在此线程中讨论 http://sphinxsearch.com/forum/view.html?id=2867
Funny that just 5 minutes after I finally make the SO post, I discover the answer...
Here it is: you must have at least one text column or sphinx will not index your data!
Discussed in this thread http://sphinxsearch.com/forum/view.html?id=2867