0
我有两个模型:'A'和'B',并且想用这两个模型来搜索物体,但是我希望首先使用模型'A'的所有结果,然后' B”。我怎样才能做到这一点? 我通过以下选项狮身人面像查询根据模型偏好思考狮身人面像结果
{: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”对象第一。我怎样才能做到这一点?
这是一个很好的黑客,并将在许多地方有用。目前,我使用了field-weights选项来更加重视'A'模型对象。谢谢。 – skadoosh