windows执行代码
1、coreseek_main.bat
e:\coreseek\bin\indexer -c E:\coreseek\etc\csft_mysql.conf --all --rotate
2、coreseek_merge.bat
e:\coreseek\bin\indexer -c E:\coreseek\etc\csft_mysql.conf --merge main increment --rotate --merge-dst-range deleted 0 0
3、coreseek_increment.bat
e:\coreseek\bin\indexer -c E:\coreseek\etc\csft_mysql.conf increment --rotate
#MySQL数据源配置
#请先将var/test/1193379199.sql导入数据库,并配置好以下的MySQL用户密码数据库
源文件csft_mysql.conf
#源定义
source main
{
type = mysql
sql_host = 127.0.0.1
sql_user = root
sql_pass = 1193379199
sql_db = www_didiche_cn_h
sql_port = 3306
sql_query_pre = SET NAMES utf8
sql_query_pre = REPLACE INTO e_sphinx SELECT 5,MAX(itemid) FROM e_sell_5
sql_query = SELECT itemid, vip, edittime as sorttime, username, title, introduce,status FROM e_sell_5 WHERE itemid<=(SELECT maxid FROM e_sphinx WHERE moduleid = 5)
#sql_field_string = title
sql_attr_bigint = vip
sql_attr_bigint = status
sql_attr_timestamp = sorttime
sql_query_info = SELECT * FROM e_sell_5 WHERE itemid=$id
}
source increment:main
{
sql_query_pre = SET NAMES utf8
sql_query = SELECT itemid, vip, edittime as sorttime, username, title, introduce,status FROM e_sell_5 WHERE itemid>(SELECT maxid FROM e_sphinx WHERE moduleid = 5)
}
#index定义
index main
{
source = main #对应的source名称
path = E:/coreseek/var/data/mysql #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
html_strip = 0
#中文分词配置
#charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾
charset_dictpath = E:/coreseek/etc/
#Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/...
charset_type = zh_cn.utf-8
ngram_len = 0
}
index increment:main
{
source = increment
path = E:/coreseek/var/data/increment
}
#全局index定义
indexer
{
mem_limit = 128M
}
#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:/coreseek/var/log/searchd_mysql.pid #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
log = E:/coreseek/var/log/searchd_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
query_log = E:/coreseek/var/log/query_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
}
1.创建主索引:
indexer -c d:\coreseek\etc\csft_mysql.conf --all --rotate
2.添加数据
3.再创建增量索引:
indexer -c d:\coreseek\etc\csft_mysql.conf increment --rotate
4.合并索引:
indexer -c d:\coreseek\etc\csft_mysql.conf --merge main increment --rotate --merge-dst-range deleted 0 0
search -c d:\coreseek\etc\csft_mysql.conf 供应
search -c d:\coreseek\etc\csft_mysql.conf apple
安装
bin\searchd --install --config e:/coreseek/etc/csft_mysql.conf
indexer -c e:\coreseek\etc\csft_mysql.conf --all --rotate
searchd --config --config e:/coreseek/etc/csft_mysql.conf