views:

70

answers:

1

I want to tune the relevance of solr search results on a per user basis - based on the number of times the user 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).

A: 

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.

Mauricio Scheffer
Cheers for the pointer to dynamic fields - looks like the way to do the job if adding the user clicks into the index. Would still love to be able to pass an elevation rule with the query and avoid the extra indexing though.
plusplus