Lots of Thinking Sphinx questions from me lately. Here's another one:
In some of my searches I'd like to only query some of all the fields included in my index definition. I can't seem to find any on this, the nearest thing being limiting the global search to specific models.
So.. is it possible to query only a given subset of fields in an index?
This is possible through Sphinx's extended match syntax:
Model.search "@(name,description) ruby pancakes", :match_mode => :extended
Where name and description are fields you're searching on, and 'ruby pancakes' is the search query.
Now when Sphinx v3 is out, the documentation says that extended mode is turned on by default so you just need to do something like:
Model.search "@(name,description) ruby pancakes"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With