0

第一次接触sphinx 查阅了文档,没有找到相关的答案,速来思否求答案,希望思否的各位sphinx大神能给点思路

//sphinx.conf

source anhaofour_doctoruser
{

        type            = mysql
        sql_host        = localhost
        sql_user        = ''
        sql_pass        = ''
        sql_db          = ''
        sql_port        = 3306  # optional, default is 3306
        sql_query_pre   = SET NAMES utf8
        #sql_query_pre  = SET SESSION query_cache_type=OFF
        sql_query= SELECT a.`doctoruid`,a.`doctorname`,a.`service_number`,a.`department_name` ,a.`hospital_name`,a.special_signed,c.doclevelname as `doctor_level_name`, b.`specialty`   FROM  `doctor_user` a  left  join `doctor_user_profile` b  on  a.doctoruid=b.doctoruid left join doctor_level c on a.doctor_level=c.doclevelid left join doctor_service d on a.doctoruid=d.doctor_id  WHERE  a.doctoruid>=$start AND a.doctoruid<=$end AND d.type=1 AND d.open=1  AND  a.status=1 and a.authentication_status=1
        sql_query_range = SELECT MIN(doctoruid),MAX(doctoruid) FROM doctor_user
        sql_range_step  = 2000
        sql_attr_uint = doctoruid
        sql_attr_uint=service_number
        sql_field_string = doctorname
        sql_field_string= hospital_name
        sql_field_string=department_name
        sql_attr_string=specialty
        sql_attr_uint=special_signed
        sql_attr_string=doctor_level_name
        sql_ranged_throttle = 0 
        #sql_query_info= SELECT * FROM doctor_user WHERE id=$id
}



index anhaofour_doctoruser
{
        source          = anhaofour_doctoruser
        path            = /data/db/sphinx-3.0.2/anhaofour_doctoruser
        #docinfo        = extern
        mlock           = 0
        morphology      = none
        min_word_len    = 3
        #charset_type   = utf-8
        min_prefix_len  = 0
        html_strip      = 1
        charset_table   = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
        ngram_len       = 2
        ngram_chars     = U+3000..U+2FA1F
        preopen         = 1
        #ondisk_dict    = 0
        html_remove_elements    = style, script
}

索引也成功生成了

clipboard.png

sphinx启动之后是这样的

clipboard.png

代码确定是没问题的,线上正常在跑,线下的服务器迁移之后,出现了这样的问题

[message:protected] => Searching index "anhaofour_doctoruser" for "" failed with error "index anhaofour_doctoruser: parse error: unknown column: id".

萧逸 661
2018-03-30 提问
0 个回答

撰写答案

推广链接