日期:2014-05-17  浏览次数:20909 次

windows coreseek 安装配置实时更新
1、bin\csft_mysql.conf:
#源定义
source mysql
{
    type                    = mysql

    sql_host                = localhost
    sql_user                = root
    sql_pass                = merry05
    sql_db                    = test
    sql_port                = 3306
    sql_query_pre            = SET NAMES utf8
    sql_query                = SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title,content FROM documents
                                            #sql_query第一列id需为整数
                                            #title、content作为字符串/文本字段,被全文索引
    sql_attr_uint            = group_id            #从SQL读取到的值必须为整数
    sql_attr_timestamp        = date_added      #从SQL读取到的值必须为整数,作为时间属性

    sql_query_info            = SELECT * FROM documents WHERE id=$id  #命令行查询时,从数据库读取原始数据信息
    sql_query_post_index    = REPLACE INTO counter (uid,maxid) VALUES (1,$maxid)
}

#index定义
index mysql
{
    source            = mysql             #对应的source名称
    path            = var/data/mysql
    docinfo            = extern
    mlock            = 0
    morphology        = none
    min_word_len        = 1
    html_strip    = 0
    charset_dictpath = etc/                        #Windows环境下设置,/符号结尾
    charset_type        = zh_cn.utf-8
    #charset_table=......
    ngram_len=0
}

source delta:mysql
{
    sql_query_pre = SET NAMES utf8
    sql_query = SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title,content FROM documents WHERE id>(SELECT maxid FROM counter WHERE uid=1)
}
#增量索引
index delta:mysql
{
  &