栏目导航: 首页 > 网站运营 > 开发设计 > 内容

Sphinx/Coreseek做增量索引更新

www.hx99.net    时间: 2015-06-14    阅读: 次     整理: 华西安全网

 #MySQL数据源配置,详情请查看:http://www.coreseek.cn/products-install/mysql/

#请先将var/test/documents.sql导入数据库,并配置好以下的MySQL用户密码数据库

 

#源定义

source mysql

{

    type                    = mysql

    sql_host                = localhost

    sql_user                = root

    sql_pass                = 

    sql_db                    = 

    sql_port                = 3306

    sql_query_pre            = SET NAMES utf8

    sql_query                = SELECT id,content FROM 表名

    sql_query_info_pre      = SET NAMES utf8                                        #命令行查询时,设置正确的字符集

    sql_query_info            = SELECT * FROM 表名 WHERE id=$id #命令行查询时,从数据库读取原始数据信息

}

#增量索引 源定义

source delta:mysql{

    sql_query_pre            = SET NAMES utf8

    sql_query                = SELECT id,content FROM data_content_copy

    sql_query_info_pre      = SET NAMES utf8                                        #命令行查询时,设置正确的字符集

    sql_query_info            = SELECT * FROM data_content_copy WHERE id=$id

}

#index定义

index main

{

    source            = mysql             #对应的source名称

    path            = E:/dmz/core/var/data/main

    docinfo            = inline

    mlock            = 0

    morphology        = none

    min_word_len        = 3

    html_strip                = 0

ondisk_dict = 1

    charset_dictpath = E:/dmz/core/etc/                             #Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/...

    charset_type        = zh_cn.utf-8

}

#增量索引 index定义

index delta:main{

    source          = delta

    path            = E:/dmz/core/var/data/add

    charset_dictpath = E:/dmz/core/etc/

    charset_type    = zh_cn.utf-8

}

#全局index定义

indexer

{

    mem_limit            = 512M

}

 

#searchd服务定义

searchd

{

    listen                  =   9312

    read_timeout        = 5

    max_children        = 30

    max_matches            = 1000

    seamless_rotate        = 0

    preopen_indexes        = 0

    unlink_old            = 1

    pid_file = E:/dmz/core/var/log/searchd_mysql.pid  #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...

    log = E:/dmz/core/var/log/searchd_mysql.log        #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...

    query_log = E:/dmz/core/var/log/query_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...

    #binlog_path =                                #关闭binlog日志

}

本文来源:华西安全网[http://www.hx99.net]
发表评论】【告诉QQ好友】【错误报告】【加入收藏】【关闭