Sun conjunction and disjunctions don't work

I am getting this error NoMethodError: undefined method 'any' for #<Sunspot::DSL::Search:0x000000037a8070>

when i try to do it like in the 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 am using the latest version of sunspot 2.1.1

. I am using defaultOperator="OR"

xml in my schema and I want AND both results. It works if I could add AND

between the two requests with adjust_solr_params

, but I have many more conditions, like raising the exact match and the other part, checking for a specific textarea. I want to achieve an increase in records with exact matches and also give ngram results. Thus, currently ngram does not give results due to ANDING exact match results. Any suggestion how I can achieve this.

+3


source to share


1 answer


According to this issue, all were added after the 2.1.1 release.

The documentation for your version does not have these methods: https://github.com/sunspot/sunspot/tree/v2.1.1



So, to use all | everything, you have to use the edge version or wait for the next version.

0


source







All Articles