1. Download Sphinx Source Package
http://sphinxsearch.com/downloads/current/
Copy link address in Xshell terminal use: wget http://sphinxsearch.com/files/sphinx-2.3.1-beta.tar.gz
Note: It is generally downloaded to the/USR/LOCAL/SRC directory (I define the/data/soft myself)
Installation is generally installed to/usr/local/sphinx (Sphinx This directory is custom)
Unzip in this directory using the tar command: Tar zxvf sphinx-2.3.1-beta.tar.gz
2, start the compilation note: Source code installation must be installed GCC, installation Kit
Installation Kit command: Yum-y install make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel Note: (Yum -Y is not necessary to determine the installation, can not install the installation is completed without error will be able to compile
installation command:./configure--prefix=/usr/local/sphinx (--prefix= installation directory)
The installation will tell you to compile, welcome to Sphinx
3. Make build compilation file does not compile
Make install to compile//warn ignore
can also be performed together: Make && makes install//if make error is followed by make install will not execute
(Boot command: chconfig--level 345 httpd on//apache boot chconfig--level mysqld 345 on MySQL boot)
4. Test into the installation directory
Cd/usr/local/sphinx/etc
Copy a configuration item first CP sphinx.conf.dist sphinx.conf
To configure:
VI sphinx.conf
Link database:
#这里我用了utf8mc4 emoji expression for special treatment
Note: In/usr/local/sphinx/ect This directory will have a SQL file to import this SQL file into the database
Command: Mysql-uroot-proot </usr/local/sphinx/etc/example.sql
Enter MySQL after executing the command to see if the import was successful
Build the index below Cd/use/local/sphinx/bin
./indexer--all generating All index files
./search the value to query
/indexer--all execution will appear
Here because of my previous database directory in/DATAS/SOFT/MARIADB
Execute the following command soft link to ln-s/datas/soft/mariadb/lib/libmysqlclient.so.18/usr/lib64/libmysqlclient.so.18
Index established successfully.
Linux installation sphinx+mariadb