Per query relevance elevation for solr?
I want to tune the relevance of solr search results on a per user basis - based on the number of times the u开发者_高级运维ser has clicked through a result before. Frequently hit items FOR THAT USER should rise to the top of their search results.
Is there a way to provide custom boost/elevation for particular document ids on the query? I'm thinking in the order of ~100s of particular documents to elevate. The elevation should have no effect if the rest of the query doesn't find those documents.
Alternatively, if this isn't possible, what is a sane way for setting up an alternative indexing approach that would make this possible? Could I add a field per user in the index to store their scores? I'm thinking in the order of 1000 users. The major drawback of that approach is the number of times a document would need to be reindexed (i.e. each time it was used by the user).
You could set up a dynamic field to store the user clicks, for example:
<dynamicField name="*_clicks" type="integer" indexed="true" stored="true"/>
and you'd store the clicks in fields like user12322_clicks, user15000_clicks, etc.
Take a look at this very similar question for information on how to boost.
精彩评论