【发布时间】:2014-02-12 10:39:03
【问题描述】:
我有两个模型:“A”和“B”,并且想使用 Thinking sphinx 从它们中搜索对象,但我想要模型“A”的所有结果,然后是“B”。我怎样才能做到这一点? 我将以下选项传递给 sphinx 查询
{:match_mode=>:extended, :sort_mode=>:extended, :star=>true, :order=>"@relevance DESC", :ignore_errors=>true, :populate=>true, :per_page=>10, :retry_stale=>true, :classes => [A,B]}
然后使用以下方法获取搜索结果:
ThinkingSphinx.search "*xy*", options
但它给出了混合排序的结果,而我首先需要所有“A”对象。我该怎么做?
【问题讨论】:
标签: ruby-on-rails thinking-sphinx