Install and configure Sphinx search on Ubuntu

Sphinx Installation and Configuration

A:- Install
1- Extract the tar ball (download from www.sphinxsearch.com)
2- ./configure –prefix /usr/local/sphinx
3- make
4- make install

B:- Configure
1- The initial sphinx.conf in etc in the above dir is ok, just change the db connection.

2- To remove the commented lines from the above conf file use ubuntu command grep as:
cat sphinx.conf | grep -v “[#]” > sphinx.conf.min
the v is used to inverse the match.

2.5 Import the sample DB by
mysql -uroot -proot test < /path_extracted_tar/example.sql

3- Install the service as:
searchdĀ  –config sphinx.conf

4- Check status as
searchd –status

5- Start indexer
indexer –rotate –all

6- test by using search in bin/
search test

7- Test using SphinxQL
mysql –host=127.0.0.1 –port=9306
select * from test1 where match(‘test’);

8- Test with php API ( in extracted tar dir/api)

php test.php test

Leave a Comment

Your email address will not be published. Required fields are marked *