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文件,可以聯繫我,在評論中留下您的郵箱即可。