Have I mentioned how much I love the Sphinx search engine?
I think that I have.
I want to talk about how I used Sphinx to create a new faceted search for Ravelry but I don’t really know where to begin. I’m was happy while working on it and I’m happy with the result. Sphinx itself performs amazingly and that amount of code needed to make it all work is pretty small and very sensible. It’s really surprising how many ways you can take advantage of what it has to offer – someone should really write a “Sphinx Recipes” book.
For now, here is a video. It was made to introduce the features to Ravelers so it doesn’t point out any of the technical things that I’d like to show. It’s just a little peek that gives you some idea of what can be done with Sphinx beyond plain old full text search. Sphinx is handling the full text search, the filtering by facet, the computing of counts in each facet, and the selection of results. Pretty much everything other than pulling the data to display the photos and names. All of the work is done in a single call to Sphinx – one query “batch”.
One more neat thing: Here is one of the facets in the people search. Sphinx knows how to calculate geodistance so given a search, it can create a facet by grouping results by distance from some point…and it does it fast.