Linux環境為:CentOS5.5、Ubuntu12.04
1、軟體下載
sphinx-2.1.3
coreseek-4.1
2、安裝sphinxp -with-mysql:指定mysql 安裝路徑
tar zxvf sphinx-2.1.3.tar.gz //解压sphinx包 cd sphinx-2.1.3 ./configure --prefix=/usr/local/sphinx --with-mysql=/usr/local/mysql/
編譯並安裝
sudo make && make install
indexer 创建索引命令 searchd 启动进程命令 search 命令行搜索命令
cd /usr/local/sphinx/etc
sudo cp sphinx.conf.dist sphinx.conf
$ cd /usr/local/sphinx/etc $ sudo /usr/local/sphinx/bin/indexer --all
ERROR: index 'test1stemmed': sql_connect: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
#sql_sock = /tmp/mysql.sock
$ cd /usr/local/sphinx/etc $ sudo /usr/local/sphinx/bin/search test
index 'test1': search error: query too complex, not enough stack (thread_stack=-2665032K or higher required).
#sql_query_info = SELECT * FROM documents WHERE id=$id
$ cd /usr/local/sphinx/etc $ sudo /usr/local/sphinx/bin/searchd
$ cd sphinx/api $ php test.php test
Query 'test ' retrieved 3 of 3 matches in 0.022 sec. Query stats: 'test' found 10 times in 6 documents Matches: 1. doc_id=1, weight=101, group_id=1, date_added=2014-01-20 10:07:37 2. doc_id=2, weight=101, group_id=1, date_added=2014-01-20 10:07:37 3. doc_id=4, weight=1, group_id=2, date_added=2014-01-20 10:07:37
tar zxvf coreseek-4.1.tar.gz
cd mmseg-3.2.14/ ./configure --prefix=/usr/local/mmseg
sudo apt-get install automake aclocal libtoolize --force 我运行后有一个错误,没管它。 automake --add-missing autoconf autoheader make clean ./configure --prefix=/usr/local/mmseg make sudo make install
cd csft-4.1/ sh buildconf.sh ./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/ sudo make && make install
cd /usr/local/coreseek/bin/ ./searchd