Sphinx full text indexing with MySQL
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.






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.
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.
Hi François,
You mentioned that you have code to convert mysql dump into xml… can you please share that?
Cheers,
Salman
Hi François,
I figured it out… thanks anyways!