coreseek使用心得
基本使用方法:
D:\coreseek-4.1\bin\searchd -c D:\coreseek-4.1\etc\article.conf --stop 停止服务 D:\coreseek-4.1\bin\searchd -c D:\coreseek-4.1\etc\article.conf 启动服务 D:\coreseek-4.1\bin\indexer -c D:\coreseek-4.1\etc\article.conf --all 建立索引 D:\coreseek-4.1\bin\indexer -c D:\coreseek-4.1\etc\article.conf article_delta --rotate 创建增量索引 D:\coreseek-4.1\bin\indexer -c D:\coreseek-4.1\etc\article.conf --merge article article_delta --rotate 创建增量索引后合并索引
如果无法启动,可以停止服务sc stop Coreseek或卸载服务sc delete Coreseek后,再重新安装服务
D:\coreseek-4.1\bin\searchd --install --config D:\coreseek-4.1\etc\article.conf --servicename Coreseek,安装完成后,可以直接在服务里进行启动,启动后就OK了。
在配置时,请先注册服务,再创建索引,然后再在服务里启动coreseek;
下面为配置文件示例:
source article
{
type = mysql
sql_host = 192.168.1.2
sql_user = sql_user
sql_pass = 123456789
sql_db = sql_db
sql_port = 3306
sql_query_pre = SET NAMES gbk
sql_query_pre = REPLACE INTO sph_counter SELECT 1, MAX(article_id) FROM article
sql_query = SELECT article_id,article_cate_id,UNIX_TIMESTAMP(article_time) as article_time,article_title,article_content FROM article where article_is_show = 0 order by article_id desc
sql_attr_uint = article_cate_id
sql_attr_timestamp = article_time
sql_query_info_pre = SET NAMES gbk
sql_query_info = SELECT * FROM article WHERE article_id=$id
}
source article_delta : article
{
sql_query_pre = SET NAMES gbk
sql_query = SELECT article_id,article_cate_id,UNIX_TIMESTAMP(article_time) as article_time,article_title,article_content FROM article where article_is_show = 0 order by article_id desc
sql_query_post_index = REPLACE INTO sph_counter SELECT 1, MAX(article_id) FROM article
}
index article
{
source = article
path = D:\data\mysql\article
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
html_strip = 0
#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
charset_dictpath = D:\coreseek-4.1\etc\
charset_type = zh_cn.gbk
#sql_query_pre = SET NAMES utf8
}
index article_delta : gp_doc
{
source = article_delta
path = D:\data\mysql\article_delta
}
indexer
{
mem_limit = 128M
}
searchd
{
listen = 9312
read_timeout = 5
max_children = 30
max_matches = 4000
seamless_rotate = 0
preopen_indexes = 0
unlink_old = 1
compat_sphinxql_magics = 0
pid_file = D:\data\log\searchd_gp_doc.pid
log = D:\data\log\searchd_gp_doc.log
query_log = D:\data\log\query_gp_doc.log
#binlog_path =
}
如果无法启动,请新建如下几个目录和文件
【目录】D:\data\mysql\article
【文件】D:\data\log\searchd_gp_doc.pid
【文件】D:\data\log\searchd_gp_doc.log
【文件】D:\data\log\query_gp_doc.log
创建索引后,在命令行中能搜索英文和数字,却搜索不到中文,请修改一下配置文件的编码,如果将gbk尝试修改为utf8试下。
如果需要完整的coreseek文件,可以联系我,在评论中留下您的邮箱即可。