I have just uploaded to CPAN the latest version of Sphinx::Search, the Perl API for the Sphinx Search Engine.
Search for Sphinx::Search on CPAN to get the latest.
Version 0.08 is suitable for Sphinx 0.9.8-svn-r871 and later (currently r909). This version fixes a couple of bugs related to error checking.
I have been asked a few times what makes Sphinx::Search different from the Perl API that comes bundled in the contrib directory of the Sphinx distribution. The bundled Sphinx.pm was used as the starting point of Sphinx::Search. Maintenance of that version appears to have lapsed at sphinx-0.9.7, so many of the newer API calls are not available there. Sphinx::Search is mostly compatible with the old Sphinx.pm except:
- On failure, Sphinx::Search returns undef rather than 0 or -1.
- Sphinx::Search ’Set’ functions are cascadable, e.g. you can do
Sphinx::Search->new ->SetMatchMode(SPH_MATCH_ALL) ->SetSortMode(SPH_SORT_RELEVANCE) ->Query("search terms")
- Sphinx::Search also provides documentation and unit tests, which were the main motivations for branching from the earlier work.
Sphinx has proven to be a very efficient and better quality search engine than the built-in MySQL full text search. It is an order of magnitude faster for large data sets and provides better options for controlling search result relevancy.