Using Thinking Sphinx in my rails app, I set it up to allow partial match with infix (for example, searching for “tray” would match “ashtray”).
However, I’d like complete word match to have more weight (relevance) than infix match.
So, if my search for ‘tray’ returns these 3 results : “Silver Tray”, “Ashtray” and “Some other tray” – I want the “Ashtray” to be the last result when sorting by relevance.
Is there a way to configure Sphinx to do that ?
You need to define your own ranker. Here’s how the default ones look like:
http://sphinxsearch.com/docs/2.0.6/weighting.html