I have multiple versions of docs. Timestamp is used in _docIds so that when searched over a time range I get matching docs and I keep just the latests doc from the result set.
Now I need to do aggregation so that it can be used in facets. Is there a way I can do this without doing multiple queries to elasticsearch as mentioned in this discussion?
The linked discussion seems to be quite old. Is there a better way to achieve this in 5.x or 6.x ?