I have an Elasticsearch index continuously being updated and I'm creating a second index with the same mappings for doing offline analytics: I need to store changes for certain fields, in order to retrieve the values that were associated in specific time in the past. Therefore, in this second index I store multiple versions of the same document (same id
but different _id
fields).
My objective is to get ranked results for a given query and reference date. I've tried with aggregations but rather than modifying the hits
fields you get a new aggregations
one with unordered results.
Is there any way other than removing duplicates at the client side?
This is similar but different to this previous question as the proposed solution of just having a boolean current
field allows for removing duplicates when querying the present.