Elasticsearch decay score based on occurrence Elasticsearch decay score based on occurrence elasticsearch elasticsearch

Elasticsearch decay score based on occurrence


Any reason you can't use grouping? Just group by user and define the order for the group.


You cannot diversify elasticsearch sorting. You can only random_seed score the documents and hope for the best. You can use something like a top hits aggregator to aggregate buckets per author, but you cannot paginate a group of buckets. Therefore breaking pagination.

See here for more information


EDIT: before you downvote this answer just because it is Lucene related and not a real answer to the question: 1. ElasticSearch is Lucene-based 2. What the OP wants to do is really hard to do and I was just trying to help...

You could try to play around with decay from here:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-function-score-query.html

However this doesn't allow for back-referencing on the previous hits of the current query (as a technique would need to match your use case)

I have encountered a similar problem to yours in a webapp that we used Lucene/Hibernate-Search for and I didn't really get a satisfying result and it still bothers me.

I think it is best to try to get a good user experience by trying to implement the ordering in another way.