当前位置:编程学习 > php >>

sphinx coreseek 初探

遇到了一些问题也都在上面的网站中找到了答案

下面是我的索引配置文件mysql.conf的内容


[php]
source mysql 

    type                = mysql 
 
    sql_host                = localhost 
    sql_user                = root 
    sql_pass                = mfy 
    sql_db                = zlk 
    sql_port                = 3306 
    sql_query_pre            = SET NAMES utf8 
 
    sql_query                = SELECT id,pic_id,city,captionwriter,countryname,title,description,contenttype,generator,author,keyword,language,datecreatedline  FROM picture_info 
                                                              #sql_query第一列id需为整数 
                                                              #title、content作为字符串/文本字段,被全文索引 
   # sql_attr_uint            = id           #从SQL读取到的值必须为整数 
   sql_attr_uint            = pic_id           #从SQL读取到的值必须为整数 
   sql_attr_timestamp        = datecreatedline #从SQL读取到的值必须为整数,作为时间属性 
   # sql_attr_str2ordinal       = title 
 

 
#index定义 
index mysql 

    source            = mysql             #对应的source名称 
    path            = /usr/local/coreseek/var/data/mysql 
 
    docinfo            = extern 
    mlock            = 0 
    morphology        = none 
    min_word_len        = 1 
    min_infix_len =1 
    html_strip                = 0 
    charset_dictpath = /usr/local/mmseg3/etc/    #BSD、Linux环境下设置,/符号结尾 
    #charset_dictpath = etc/                        #Windows环境下设置,/符号结尾 
    charset_type        = zh_cn.utf-8 

#全局index定义 
indexer 

    mem_limit           = 2G 

 
 
searchd 

       listen                                   = 9312 
       max_matches                              = 10000 
       pid_file                                 = /usr/local/coreseek/var/log/searchd_mysql.pid 
       log                                      = /usr/local/coreseek/var/log/searchd_mysql.log 
       query_log                                = /usr/local/coreseek/var/log/query_mysql.log 

source mysql
{
    type                = mysql

    sql_host                = localhost
    sql_user                = root
    sql_pass                = mfy
    sql_db                = zlk
    sql_port                = 3306
    sql_query_pre            = SET NAMES utf8

    sql_query                = SELECT id,pic_id,city,captionwriter,countryname,title,description,contenttype,generator,author,keyword,language,datecreatedline  FROM picture_info
                                                              #sql_query第一列id需为整数
                                                     

补充:Web开发 , php ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,