首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

[centos]coreseek配置模拟实时目录

2014-01-08 
[centos]coreseek配置模拟实时索引CREATE TABLE sph_counter(counter_id INTEGER PRIMARY KEY NOT NULL,ma

[centos]coreseek配置模拟实时索引
CREATE TABLE sph_counter( counter_id INTEGER PRIMARY KEY NOT NULL, max_doc_id INTEGER NOT NULL);

?

[3] 第二步,修改配置文件

source src1{        type = mysql        sql_host = localhost        sql_user = root        sql_pass =         sql_db = test        sql_port = 3306        sql_query_pre = SET NAMES utf8        sql_query = SELECT id,title,content,create_time FROM ps_news        sql_attr_uint = id        sql_attr_timestamp  = create_time        sql_query_info_pre  = SET NAMES utf8}index src1{        source = src1        path = /usr/local/coreseek/var/data/src1/        docinfo = extern        mlock = 0        morphology = none        min_word_len         = 1        html_strip = 0        charset_type = zh_cn.utf-8        charset_dictpath = /usr/local/mmseg3/etc/        #charset-table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F        #ngram_len = 1        #ngram_chars = U+3000..U+2FA1F}#global indexerindexer{    mem_limit            = 128M}#searchdsearchd{    listen              = 9312    read_timeout        = 5    max_children        = 30    max_matches         = 1000    seamless_rotate     = 0    preopen_indexes     = 0    unlink_old= 1    pid_file= /usr/local/coreseek/var/log/searchd_rtindex.pid    log = /usr/local/coreseek/var/log/searchd_rindex.log           query_log = /usr/local/coreseek/var/log/query_rtindex.log}

?

[3] 写3个脚本,让系统自动生成增量索引和合并索引和重建索引

#delta.sh文件#!/bin/sh/usr/local/coreseek/bin/indexer delta --rotate#main.sh文件#!/bin/sh/usr/local/coreseek/bin/indexer --all --rotate#merge.sh文件#!/bin/sh/usr/local/coreseek/bin/indexer --merge main delta --rotate --merge-dst-range deleted 0 0

?

[4] 写计划任务每隔一分钟执行一遍delta.sh,每五分钟执行一遍merge.sh,每天1:30执行main.sh

?

*/1 * * * * /bin/sh /usr/local/coreseek/sh/delta.sh*/5 * * * * /bin/sh /usr/local/coreseek/sh/merge.sh30 1 * * * /bin/sh /usr/loca/coreseek/sh/main.sh

?

热点排行