1

我有三个模型(在导轨中)关联如下

class Content
  has_and_belongs_to_many :groups
end

class Group
  has_and_belongs_to_many :groups
  has_and_belongs_to_many :users
end

class User
  has_and_belongs_to_many :groups
end

当我在 Sunspot 中搜索内容时,我希望显示所有内容。但是,我希望当前用户所属的任何组中的内容首先出现。

这可能吗?

4

1 回答 1

0

是的,您应该能够在 Solr 文档中添加一个额外的列,并对该列进行排序。

于 2011-06-09T13:44:32.333 回答