ElasticSearch Max of Max?

(Varun Sharma) #1

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?

(Nik Everett) #2

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.

(Varun Sharma) #3

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

(system) #4

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