Elasticsearch index with historical versions of documents

I’ve constantly updated the Elasticsearch index, and I’m creating a second index with the same mappings for offline analytics: I need to save changes for certain fields in order to get values ​​that were connected at a certain time in the past. Therefore, in the second index, I store several versions of the same document (the same id, but different fields _id).

My goal is to get ranked results for a given query and key date. I tried with aggregations, but instead of changing the fields hits, you get a new one aggregationswith unordered results.

Is there a way besides removing duplicates on the client side?

This is similar, but different from this previous question , because the proposed solution with only a Boolean field currentallows you to remove duplicates when requesting the present.

+4
source share

Source: https://habr.com/ru/post/1672734/


All Articles