I’m trying to search a Model by the state field using Acts As Ferret.
The query for this is ‘+state:NY’ (substitute state abbreviation for
NY). This works find however ‘+state:OR’ returns nothing, though just
‘portland’ will pull up matches within that state.
I’m pretty sure it’s reading OR as an or conditional instead of a state.
Anyway to escape it to fix this issue?
I’m trying to search a Model by the state field using Acts As Ferret.
The query for this is ‘+state:NY’ (substitute state abbreviation for
NY). This works find however ‘+state:OR’ returns nothing, though just
‘portland’ will pull up matches within that state.
Hi, I am a novice in rails. I too ran in to the same issue.
I did follow your method but am a bit confused…
My model has
acts_as_ferret :fields => {
:description => {:store => :yes},
:state => {:index => :untokenized}}, #:store_class_name => :true,
:remote => false
and in my controller I search with this
I do not understand where should I use the line code
Ferret::Analysis::FULL_ENGLISH_STOP_WORDS.include?(‘or’)=> true
I am unable to get the desired result when ‘OR’ is passed as a state.
Can you kindly be patient and explain me what am I missing?
Any help would be highly appreciated.
Cheers,
Vinay
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.