切换到配置文件目录
/usr/local/coreseek/etc
配置文件(coreseek默认配置文件为csft.con)
cp sphinx.conf.dist csft.confvi csft.conf
修改配置文件
# known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc type = mysql ##################################################################### ## SQL settings (for 'mysql' and 'pgsql' types) ##################################################################### # some straightforward parameters for SQL source types sql_host = localhost sql_user = root sql_pass = root sql_db = test sql_port = 3306 # optional, default is 3306 #sql_sock = /tmp/mysqld.sock #如果是linux下需要开启,指定sock文件 sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF #关闭缓存charset_type = zh_ch.utf-8charse_dictpath = /usr/local/mmseg3/etc/sql_query_info = SELECT * FROM documents WHERE id=$id
测试
/usr/local/coreseek/bin./indexer --all
创建搜索配置文件csft.conf,过程跟安装测试sphinx一样,但是创建索引时报了一个这样的错误:
FATAL: index 'test1': 'synonyms': failed to open '/data/exceptions.txt'
进入配置文件csft.conf,把/data/exceptions.txt注释掉即可,创建完索引,运行测试OK。