ElasticSearch Max of Max?

I need to search for max time (Recent entries), out of those max entries I want one with max value. I've tried various types of nesting on aggregation, using filters,etc. but it doesn't seem to work out. Any help?

Elasticsearch doesn't have a native "give me the value of X on the document with the maximum value of Y" aggregation. You have to hack it together with scripted_metric.

What about returning all the field or specific fields corresponding to the doc with Max Value of time?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.