问题描述
|
我有三个关联的模型(如下所示)
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文档中添加一个额外的列并对该列进行排序。