在标量字段和全文搜索之间执行OR查询?

时间:2014-12-06 20:59:07

标签: solr sunspot sunspot-rails sunspot-solr

Book.search do
  any do
    fulltext "tupac"
    with :tags, ["southpark"]
  end
end

由于any仅接受全文,any_of仅接受标量字段,如何查找包含tupac或用southpark标记的图书。

1 个答案:

答案 0 :(得分:0)

Book.search do
  any do
    fulltext "tupac", minimum_match: 0
    with :tags, ["southpark"]
  end
end