下载coreseek源码软件
Coreseek-3.2.14.tar.gz //支持中文全文检索的软件
http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.14.tar.gz
安装coreseek源码包:
tar –zxvf coreseek-3.2.14.tar.gz
cd coreseek-3.2.14/
ls
csft-3.2.14 mmseg-3.2.14 README.txt testpack
// 先安装中文分词 mmseg
cd mmseg-3.2.14/
./bootstrap ##如果有错误修改
./configure--prefix=/usr/local/mmseg3
Make && make install
在配置时遇到错误:
config.status:error: cannot find input file: src/Makefile.in
遇到问题时的操作:
yum -yinstall glibc-common libtool autoconf automake expat-devel
wgethttp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz
yuminstall autoconf-2.68
tar zxvf autoconf-2.68.tar.gz
cd autoconf-2.68
./configure
make && make install
//编译安装coreseek
cd csft-3.2.14/
./configure–prefix=/usr/local/coreseek –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/
./configure--prefix=/usr/local/coreseek --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/
Make&& make install
cp/usr/local/coreseek/etc/sphinx.conf.dist /usr/local/coreseek/etc/csft.conf
vi /usr/local/coreseek/etc/csft.conf ##配置coresee 配置文件如下:
source main要检索的数据表和数据
{
type= mysql
sql_host= localhost
sql_user= root
sql_pass= root
sql_db= test
sql_port= 3306# optional, default is 3306
sql_sock= /tmp/mysql.sock
sql_query_pre= SET NAMES utf8
sql_query_pre= SET SESSION query_cache_type=OFF
sql_query = select id, title, content from post;
sql_ranged_throttle= 0
sql_query_info= SELECT * FROM post WHERE id=$id
}
index main
{
source= main
path= /usr/local/sphinx/var/data/main
docinfo= extern
mlock= 0
morphology= none
min_word_len= 1
charset_type = zh-cn.utf-8
charset_dictpath = /usr/local/mmseg/etc/
html_strip= 0
}
indexer
{
mem_limit=256M
}
searchd
{
log= /usr/local/sphinx/var/log/searchd.log
query_log= /usr/local/sphinx/var/log/query.log
read_timeout= 5
client_timeout= 300
max_children= 30
pid_file= /usr/local/sphinx/var/log/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
}
# --eof--
//测试中文检索coreseek
cd/usr/local/coreseek/bin/
./indexer–all
./search文章