太阳黑子/日光照射是否可以属于某个组?

问题描述

| 我有三个关联的模型(如下所示)
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中搜索内容时,我希望所有内容都出现。但是,我希望当前用户所属的任何组中的内容首先出现。 这可能吗?     

解决方法

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