Friday, January 8, 2010

Some Bugs That I have come Across While Using Sphinx

I have been using sphinx now for more than 10 months now and almost on a daily basis i develop new things based on sphinx search.During my recent development i have come across some of the unknown or unmentioned bugs in sphinx search.

Keyword Length has a limit

say for example in my case i had to search in my index file for keyword pizza hut in some fields like name,reviews etc and a bunch of zip codes in zip code field, these bunch of zip codes can be anything around ten to hundreds of then depending on the distance a user selects for a search. now what i did is i wrote a query like this:

@(name,review)pizza hut @(zip_code)60606|60605|........ and so on

but what i found out is that when the collection of zip codes exceeds above 90 sphinx gives me empty set.which was a big problem in my case.

so what i came up as a solution is that i divided the zip codes into groups of 50 and then queried sphinx multiple times and got the result from sphinx and then combined those results for further processing of data...