How to install and configure Sphinx in Ubuntu 9.10 with MySQL support

Description: “Sphinx is a full-text search engine, distributed under GPL version 2. Commercial license is also available for embedded use. Generally, it’s a standalone search engine, meant to provide fast, size-efficient and relevant fulltext search functions to other applications. Sphinx was specially designed to integrate well with SQL databases and scripting languages. Currently built-in data sources support fetching data either via direct connection to MySQL or PostgreSQL, or using XML pipe mechanism (a pipe to indexer in special XML-based format which Sphinx recognizes). As for the name, Sphinx is an acronym which is officially decoded as SQL Phrase Index. Yes, I know about CMU’s Sphinx project“.


* Install the packages needed: apt-get install gcc make libmysqlclient15-dev libmysql++-dev
* Download Sphinx from here.
* Decompress it: tar xvfz sphinx-*.tar.gz
* Enter its directory: cd sphinx-*
* Run configure: ./configure --prefix=/usr/local/sphinx --with-mysql
* Compile Sphinx: make
* Install Sphinx (as root): make install


* Enter Sphinx’s directory: cd /usr/local/sphinx/etc
* Make a copy of its default configuration: cp sphinx.conf.dist sphinx.conf
* Modify it to fit you database schema and preferences (I recommend reading Sphinx’s official documentation and this tutorial by IBM first).
* Create all indexes: /usr/local/sphinx/bin/indexer --all
* Something like this will be shown:

Sphinx 0.9.9-rc2 (r1785)
Copyright (c) 2001-2009, Andrew Aksyonoff

using config file '/usr/local/sphinx/etc/sphinx.conf'...
indexing index 'software'...
collected 10 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 10 docs, 649 bytes
total 0.013 sec, 48970 bytes/sec, 754.54 docs/sec
total 2 reads, 0.000 sec, 16.3 kb/call avg, 0.0 msec/call avg
total 5 writes, 0.000 sec, 0.4 kb/call avg, 0.0 msec/call avg


* You can perform a basic search using: /usr/local/sphinx/bin/search desired_word . It matches all words by default, but you can change this behaviour. Run /usr/local/sphinx/bin/search without arguments to show the available options.
* Example: /usr/local/sphinx/bin/search samba

Sphinx 0.9.9-rc2 (r1785)
Copyright (c) 2001-2009, Andrew Aksyonoff

using config file ‘/usr/local/sphinx/etc/sphinx.conf’…
index ‘software': query ‘samba ‘: returned 1 matches of 1 total in 0.000 sec

displaying matches:
1. document=10, weight=2
description=Samba is a SMB/CIFS file, print, and login server. It seamlessly integrates Linux/Unix Servers and Desktops into Active Directory environments using the Winbind daemon.

1. ‘samba': 1 documents, 2 hits

The use of /usr/local/sphinx/bin/search is just for test and debugging purposes. There are native API ports for PHP, Python, Java, Perl, and Ruby. I will explain the integration between PHP and Sphinx on another post.


  1. LemuelJuicy
    2018/07/19 at 10:43 · Reply

    Hi. I see that you don’t update your blog too often. I know that writing articles is boring and time
    consuming. But did you know that there is a
    tool that allows you to create new posts using existing content (from article directories or other blogs from your niche)?
    And it does it very well. The new articles
    are unique and pass the copyscape test. You
    should try miftolo’s tools

  2. Jamel Garnsey
    2020/01/02 at 04:34 · Reply

    Are you seeking effective advertising that doesn’t charge a fortune and gets amazing resuts? Sorry to bug you on your contact form but actually that was the whole point. We can send your ad text to sites via their contact pages just like you’re getting this note right now. You can specify targets by keyword or just do bulk blasts to websites in the country of your choice. So let’s say you’re looking to blast an ad to all the web developers in the USA, we’ll grab websites for just those and post your ad message to them. Providing you’re promoting something that’s relevant to that niche then you’ll be blessed with an amazing response!

    Send a quick note to to find out how we do this

  3. Clifford Dodds
    2021/01/12 at 00:52 · Reply

    Did you know website contact page messages like this one are in effect an excellent way to get more sales for your business? How can we do it? Super easy, we put together an ad like the one you’re reading right now for your site and we submit it to thousands contact pages on sites in whatever niche or country you want to target. Does this method of advertising work? You’re living proof that they do since you’re reading this message right now The best part is, this doesn’t cost more than a hundred bucks a month! Want more info? send an email to:

Leave a Reply

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