coreseek配置文件分析

E:\wamp\coreseek\etc>indexer company_info -c csft_mysql.conf

Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]

Copyright (c) 2007-2011,

Beijing Choice Software Technologies Inc (http://www.coreseek.com)



 using config file 'csft_mysql.conf'...

indexing index 'company_info'...

WARNING: attribute 'firstcate' not found - IGNORING    ①

WARNING: attribute 'secondcate' not found - IGNORING    ②    

WARNING: attribute 'regprovince' not found - IGNORING   ③

WARNING: attribute 'regcity' not found - IGNORING      ④

........

total 2 reads, 0.000 sec, 1.5 kb/call avg, 0.0 msec/call avg

total 7 writes, 0.000 sec, 1.2 kb/call avg, 0.0 msec/call avg-------------------------------------------------------------------



 using config file 'csft_mysql.conf'...

indexing index 'company_info'...

WARNING: attribute 'secondcate' not found - IGNORING  ①

WARNING: attribute 'regprovince' not found - IGNORING  ②

WARNING: attribute 'regcity' not found - IGNORING    ③

......

配置文件中有这两项配置

sql_query               = SELECT cid, companyname, regtime, firstcate FROM companyinfo

                                                            #sql_query第一列id需为整数,且被系统使用,无需再设置sql_attr_uint

                                                            

    #以下用sql_attr_开头的属性 设置的列是用来提示这几个列可以被函数SphinxClient::SetFilter()用来过滤     

    #相反地,sql_query中没有被设置的列就默认用作创建全文索引来使用了                                                                                                          

    sql_attr_uint           = firstcate               #从SQL读取到的值必须为整数

    sql_attr_uint            = secondcate

    sql_attr_uint            = regprovince

    sql_attr_uint            = regcity

    sql_attr_timestamp      = regtime                 #从SQL读取到的值必须为整数,作为时间属性

sql_query 项如果在右边写了‘fristcate’就会出现第一个图中的三个警告(未找到某某属性),如果没写就会出现四个警告,正好多了“未找到firstcate属性”。
因此意思是,sql_query属性查出一堆字段,下边的sql_attr_*对查出的这堆字段确定其数值类型,如果确定的字段没有在sql_query查出的这堆的字段中就会出现警告

ps:用脚本而非命令行进行查询时,若配置文件有改变,记得要重新启动服务

你可能感兴趣的:(coreseek)