现在的位置: 首页产品技术>正文
全文搜索sphinx索引警告:WARNING: attribute ‘category_id’ not found – IGNORING
2009年12月24日 产品技术 评论数 1

[root@db227 etc]# /usr/local/coreseek/bin/indexer --config /usr/local/coreseek/etc/sphinx.conf --all --rotate
Coreseek Full Text Server 3.1
Copyright (c) 2006-2008 coreseek.com
using config file '/usr/local/coreseek/etc/sphinx.conf'...
indexing index 'yicike_search'...
collected 4181763 docs, 253.5 MB
sorted 59.2 Mhits, 100.0% done
total 4181763 docs, 253465244 bytes
total 151.735 sec, 1670452.12 bytes/sec, 27559.73 docs/sec
indexing index 'yicike_search_ctitle'...
WARNING: attribute 'category_id' not found - IGNORING
WARNING: attribute 'min_price' not found - IGNORING
WARNING: attribute 'max_price' not found - IGNORING
WARNING: attribute 'product_rating' not found - IGNORING
WARNING: attribute 'clicks' not found - IGNORING
WARNING: attribute 'last_updated' not found - IGNORING
collected 2593 docs, 0.1 MB
sorted 0.0 Mhits, 100.0% done
total 2593 docs, 61127 bytes
total 0.037 sec, 1643158.00 bytes/sec, 69702.56 docs/sec
total 12 reads, 0.4 sec, 25375.1 kb/read avg, 32.4 msec/read avg
total 1095 writes, 2.2 sec, 692.5 kb/write avg, 2.0 msec/write avg
rotating indices: succesfully sent SIGHUP to searchd (pid=22482).

以上我索引相关记录,中间有六个警告,这是原因造成的呢,是sphinx.conf配置文件有不正确的地方导致的,这6个警告字段是我要进行过滤与排序的字段。我的sphinx.conf相关配置如下:

sql_query                               = \
select id,category_id,title,MANUFACTURER,MIN_PRICE,MAX_PRICE,PRODUCT_RATING,CLICKS,LAST_UPDATED,FormatProductName from pricecomparison_product
sql_attr_uint        = category_id
sql_attr_uint        = MIN_PRICE
sql_attr_uint        = MAX_PRICE
sql_attr_uint        = PRODUCT_RATING
sql_attr_uint        = CLICKS
sql_attr_timestamp   = LAST_UPDATED

正确的配置如下:

sql_query                               = \
select id,category_id,category_id as category_id_attr,title,MANUFACTURER,MIN_PRICE,MIN_PRICE as MIN_PRICE_attr,MAX_PRICE,MAX_PRICE as MAX_PRICE_attr,PRODUCT_RATING,PRODUCT_RATING as PRODUCT_RATING_attr,CLICKS,CLICKS as CLICKS_attr,LAST_UPDATED,LAST_UPDATED as LAST_UPDATED_attr,FormatProductName from pricecomparison_product
sql_attr_uint        = category_id
sql_attr_uint        = MIN_PRICE
sql_attr_uint        = MAX_PRICE
sql_attr_uint        = PRODUCT_RATING
sql_attr_uint        = CLICKS
sql_attr_timestamp   = LAST_UPDATED
作者: 蔡文卫 Leo@yicike.com
版权所有:亿赐客比较购物搜索网(http://www.yicike.com/)

目前有 1 条留言 其中:访客:1 条, 博主:0 条

  1. dawei : 2010年09月06日16:09:07  1楼

    兄弟你这样写,应该也会出现上面 6 个警告吧
    希望可以交流一下 ,QQ : 447279669

给我留言

留言无头像?


×
腾讯微博