linux 下搜索引擎sphinx下csft的安装方法

1.下载:

http://www.coreseek.cn/uploads/csft/3.1/Source/csft-3.1.tar.gz

 

2.安装

./configure --prefix=/usr/local/csft --with-python --with-mysql=/usr/local/mysql --with-mmseg=/usr/local/mmseg --with-mmseg-includes=/usr/local/mmseg/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg/lib/ --with-mysql-includes=/usr/local/mysql/include/mysql/ --with-mysql-libs=/usr/local/mysql/lib/mysql/

 

3.配置

 cp /usr/local/csft/etc/sphinx.conf /usr/local/csft/etc/csft.conf

 

 编辑csft.conf内容,如下样例

source video { type = mysql sql_host = 10.57.30.84 sql_user = root sql_pass = 123456 sql_db = ptv sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query = SELECT * FROM video_normal sql_attr_uint = cid sql_attr_uint = title sql_attr_uint = id #SELECT id, tag FROM tags WHERE id>=$start AND id<=$end; sql_ranged_throttle = 0 } index video { source = video path = /home/data/var/video docinfo = extern mlock = 0 morphology = none min_word_len = 1 min_infix_len = 0 #min_word_len = 2 charset_type = zh_cn.utf-8 charset_dictpath=/home/data/var html_strip = 0 } indexer { mem_limit = 32M } searchd { port = 3312 log = /var/log/sphinx_searchd.log query_log = /var/log/sphinx_query.log read_timeout = 5 client_timeout = 300 max_children = 30 pid_file = /var/log/sphinx_searchd.pid max_matches = 1000 #seamless_rotate = 1 preopen_indexes = 0 unlink_old = 1 mva_updates_pool = 1M max_packet_size = 8M max_filters = 256 max_filter_values= 4096 }

 

 

生成索引:

/usr/local/csft/bin/indexer --config /usr/local/csft/etc/csft.conf video 或 /usr/local/csft/bin/indexer --config /usr/local/csft/etc/csft.conf --all

启动sphinx守护进程:

/usr/local/csft/bin/searchd --config /usr/local/csft/etc/csft.conf

查询索引:

/usr/local/bin/search --config /usr/local/csft/etc/csft.conf 关键词

 

你可能感兴趣的:(linux 下搜索引擎sphinx下csft的安装方法)