开发者

Can sunspot / solar boost results that are in a certain group?

开发者 https://www.devze.com 2023-03-08 02:36 出处:网络
I have three models (in rails) associated as follows class Content has_and_belongs_to_many :groups end class Group

I have three models (in rails) associated as follows

class Content
  has_and_belongs_to_many :groups
end

class Group
  has_and_belongs_to_many :groups
  has_and_belongs_to_many :use开发者_JAVA百科rs
end

class User
  has_and_belongs_to_many :groups
end

When I do a search for content in Sunspot, I would like all content to appear. However I would like content that is in any group that the current user is a member of to appear first.

Is this possible?


Yes, it you should be able as adding an extra column to the Solr document, and sorting on that column.

0

精彩评论

暂无评论...
验证码 换一张
取 消