由于几个原因,我们正在从 Thinking Sphinx 转换为 Sunspot。我必须重写搜索逻辑,但是我不确定如何转换以下内容:
我想将搜索 :any 转换为 Sunspot。这意味着并非所有关键字都需要存在才能使对象匹配。(任何关键字都可以,并按相关性排序)。但是我在 Sunspot 文档中找不到它。
# Thinking Sphinx
search_result = Business.search([attributes[:name],attributes[:address]], match_mode: :any)
我也在寻找一种通过 Sunspot 轻松将停用词添加到 Solr 的方法。Thinking Sphinx 提供了一种在 yml 中指定它的方法。但是在 Sunspot::Rails yml 中没有等价物。