Before installing, make sure you have installed the most common components, and then download the latest Sphinx on the official website.
Yum install-y python Python-devel
http://sphinxsearch.com/downloads/release/
Please use the stable version, the online machine can not play the beta version!
Install Sphinx
Tar zxvf sphinx-2.1.4-release.tar.gz
CD Sphinx-2.1.4-release
./configure--prefix=/usr/local/sphinx–-with-mysql
Make && make install
If undefined reference to Libiconv error occurs at make
Error description
/usr/local/sphinx/src/sphinx.cpp:20060:undefined reference to ' Libiconv_open '
/usr/local/sphinx/src/sphinx.cpp:20078:undefined reference to ' Libiconv '
/usr/local/sphinx/src/sphinx.cpp:20084:undefined reference to ' Libiconv_close '
Collect2:ld returned 1exit status
MAKE[2]:* **[indexer]error1 www.111cn.net
make[2]:leaving directory '/HOME/SPHINX/SRC '
MAKE[1]: * * * [ALL] Error 2
MAKE[1]: Leaving directory '/HOME/SPHINX/SRC '
Make: * * * [all-recursive] Error 1
Solution:
Open the Configure file, find "#define USE_LIBICONV 1", remove the annotation, and change the 1 to 0.
Libsphinxclient Installation (PHP module required)
CD api/libsphinxclient
./configure–prefix=/usr/local/sphinx
Make && make install
Install the PHP Sphinx module www.111cn.net
Download Address: Http://pecl.php.net/package/sphinx
wget http://pecl.php.net/get/sphinx-1.3.0.tgz
Tar zxf sphinx-1.3.0.tgz
CD sphinx-1.3.0
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config--with-sphinx=/usr/local/sphinx/
Make && make install
After installation, in the installation directory, etc directory, there is a test data and configuration of the sample
Cd/usr/local/sphinx/etc
CP Sphinx.conf.dist Sphinx.conf will sphinx.conf inside of the database address, account password to change the good, and then Lvtao.sql
Guide Database Lvtao
Test execution
/usr/local/sphinx/bin/search Lvtao can see some information about the query.