François Schiettecatte’s Blog

August 1, 2007

Sphinx full text indexing with MySQL

Filed under: Search — François Schiettecatte @ 10:57 am

IBM DeveloperWorks has a good primer article on Sphinx, a full text search engine which integrates with MySQL.

I read the documentation on Sphinx a few weeks ago and it appears to be a reasonably good search engine, though I have not tested it yet.

There was one thing in the article that caught my attention. While the author says that Lucene does not have a PHP API, Solr which front-ends Lucene has a number of output options, one of which is specific to PHP.

Lucene itself requires a fair amount of work to get going since it is a toolkit, Solr provides a very flexible front-end to it making it easy to create new indices, add and delete documents, and provides a powerful search interface. There is no integration with MySQL as such, but it would be pretty easy to write an extractor to pull data out of a MySQL database, convert the data to XML (which is what Solr expects) and pipe that data into Solr. I did that for MySQL dump files and it took me about 30 minutes write, debug and document it.

2 Comments »

  1. Hi, we just integrated Sphinx in an Symfony-PHP project and the provided API as well as the deamon and the installation docs are very extensiv. The whole duration for the integration was 4h. So I can just recommend all PHP coders to use Sphinx search for full text indexing and searching.

    Comment by jerk (tschitschereengreen) — August 30, 2007 @ 6:52 am

  2. developerWorks is publishing a new PHP article of mine that shows how to combine Solr with PHP. The article should be available in Jan or Feb.

    Comment by Martin Streicher — November 10, 2007 @ 10:31 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Blog at WordPress.com.