Elasticsearch storage schema retention and aggregation

I think the answer you are looking for is in the post below:

Aggregation Retention