开发者

Sphinx indexer creates an empty index when i specify more than 4 attributes in sphinx.conf

开发者 https://www.devze.com 2023-02-08 14:45 出处:网络
I have an index \'colors\' with the following configuration: source colorsmain { type = mysql sql_host = 127.0.0.1

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!


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

0

精彩评论

暂无评论...
验证码 换一张
取 消