using and and or in search
Is it possible to set some option, so that I can use "or" and "and" in my search instead of "|" and "&"?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
Support Staff 1 Posted by Pat Allan on 10 Oct, 2013 12:11 AM
Hi Jonas
I'm afraid Sphinx doesn't have any settings for that… you'll need to gsub through your search queries to make those changes yourself. I've done it before in an app I've helped develop (insisting on AND and OR in uppercase):
params[:query].gsub(/\s+OR\s+/, ' | ').gsub(/\s+AND\s+/, ' ')
ANDs are implicit in Sphinx, so you don't actually need to change it to &.
Hope this helps.
Pat
2 Posted by jonasholstein on 16 Oct, 2013 12:27 PM
Thanks Pat :-)
Pat Allan closed this discussion on 13 Jan, 2014 11:18 PM.