I'm getting this error NoMethodError: undefined method 'any' for #<Sunspot::DSL::Search:0x000000037a8070>
when I try to do like as per documentation. https://github.com/sunspot/sunspot#disjunctions-and-conjunctions
Post.search do
any do
fulltext "keyword1", :fields => :title
fulltext "keyword2", :fields => :body
end
end
I'm using latest version of sunspot 2.1.1
.
I'm using defaultOperator="OR"
in my schema xml and I want to AND both the results.
It works if I could add AND
between both queries using adjust_solr_params
but I have many more conditions like e.g boosting exact match and other part, checking into specific text field.
I want to achieve the boosting the records with exact matches and also it should give ngram results as well.
So currently ngram results are not giving because of ANDing with exact matches results. Any suggestion how can I achieve this.