Can sunspot / solar boost results that are in a certain 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.
精彩评论