Max aggregation
/ Max, / AggregationMax aggregation #
A single-value metrics aggregation that keeps track and returns the maximum value among the numeric values extracted from the aggregated documents. It answers “how high does this field go” over any query — the top of a price range, the latest timestamp in a window, the biggest order that matches a filter.
How it works #
The engine walks the matching documents once, keeping the largest value seen;
any smaller value costs one comparison. Values are coerced to doubles as they
are read — integers, floats and booleans (true = 1, false = 0) qualify,
non-numeric values such as keyword strings do not.