how to install Sphinx Search on Ubuntu 10.10 with PostgreSQL

 Summary: Sphinx is GPL v-2 Commercial Licensing full-text search engine. I have tried to explain how to install sphinx on ubuntu server with Postgresql Database. Sphinx is used for creating big data indexes. The supporting Databases are Mysql, Postgresql, ODBC.

Below are step by step Installation and configuration process.
1: go to sphinx site and download the stable version.
2: Install the dependency g++ c compiler.
apt-get install gcc 
3: Now do the following steps
4: Transferred your control to directory where you download the sphinx and type the command:
mv sphinx.tar.gz(the name of file you downloaded) /usr/local
 cd /usr/local/
5: Unzip your downloaded sphinx demon.
tar zxvf sphinx.tar.gz and press enter
6: cd sphinx folder and configure with postgres
 ./configure –with-postgres /
may its give an error message:
ERROR: cannot find PostgreSQL libraries. If you want to compile with PosgregSQL support,
       you must either specify file locations explicitly using
       –with-pgsql-includes and –with-pgsql-libs options, or make sure path to
       pg_config is listed in your PATH environment variable. If you want to
       disable PostgreSQL support, use –without-pgsql option.
locate your pg_config with command # whereis pg_config this will show you the if it is installed there. if just show
pg_config:
Then install the library;
7: sudo apt-get install libpq-dev
Now again type # whereis pg_config

pg_config:/usr/bin/pg_config /usr/share/man/man1/pg_config.1.gz

Now again type the command
# ./configure –with-postgres /usr/bin/pg_config  and press enter
configuration done
——————
You can now run ‘make’ to build Sphinx binaries,
and then run ‘make install’ to install them.
8: Build the binaries:
# make
9: install the package
#make install
if it successfully leave the directory it mean you have install it.
………………………………………………………………………………………………………..
Now Sphinx is install successfully with Postgresql. You have set your queries in configuration file and run the searchd to index the database .
Set the Queries file in Crontab to update the index in every 24 hours.

Leave a Reply

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