You can declare a sortable integer field (let's call it clickNum) in your schema, setting it to zero by default for each indexed document. When a user opens a document your app triggers an update of clickNum field by setting clickNum = clickNum + 1.
At query-side you can set a muptiple sorting based on your primary sort parameter (if any) and clickNum: sort=<field name>+<direction>[,clickNum+desc]
You can avoid document update by storing your click log in an external database and reordering your results with post-query elaboration, but IMHO that's not a good option.
Read full article from Solr/Lucene user click based ranking - Stack Overflow
No comments:
Post a Comment