PHP , MySQL and Sphinx : The Perfect Trio!
Aug 11Full text searches have been the one part which would always worry me in any project which will hold a reasonable amount of data with a decent traffic. Not anymore!
I have been using Sphinx for a while and i have been really impressed. Easy deployment, easy integration and its pretty flexible as well. I cant say that i have explored everything it has to offer but whatever I needed it to do, it surely did for me.
Among other features you can use it to rank , filter , group , sort and query to targeted columns. It even supports “Sounds like” searches ….. wonderful! . With several different matching and ranking modes , ones got to be right for you.
The PHP Client is a pure PHP implementation, so no deployment headaches. The PHP client API is included in the download package, hook it up with your DB wrapper and you are ready to battle with those Full Text Searches. What it would do is .. it would return to you the ranked record IDs, along with weights and then you can bring the full record of that ID directly from MySQL. Response times from Sphinx are amazing, So far I haven’t seen it take more than 0.7 seconds to return the resultset. Best of all, you can scale as much as you need, without any problems.
Here are the key features taken from their site directly:
- high indexing speed (upto 10 MB/sec on modern CPUs)
- high search speed (avg query is under 0.1 sec on 2-4 GB text collections)
- high scalability (upto 100 GB of text, upto 100 M documents on a single CPU)
- supports distributed searching (since v.0.9.6)
- supports MySQL natively (MyISAM and InnoDB tables are both supported)
- supports phrase searching
- supports phrase proximity ranking, providing good relevance
- supports English and Russian stemming
- supports any number of document fields (weights can be changed on the fly)
- supports document groups
- supports stopwords
- supports different search modes (”match all”, “match phrase” and “match any” as of v.0.9.5)
- generic XML interface which greatly simplifies custom integration
- pure-PHP (ie. NO module compiling etc) search client API
Amazing stuff! So if you are in the business of developing high volume traffic and/or data sites … you have to check it out for sure! Its available for both Linux and Windows platforms!
2 Thumbs Up for these guys!
Comments