. , , . , , "foo", "bar" Post _ .
Post.search do
fulltext "foo", {:fields => :exact_term}
fulltext "bar", {:fields => :alternate}
end
The problem was that I could not change my schema.xml (defaultOperator) settings. It was set to "OR". If you have a similar problem, you can work around this like this:
Post.search do
adjust_solr_params do |params|
params[:q] = params[:q].gsub(/\s_query/, " AND _query") if params[:q].present?
end
end
wawka source
share