The aggregations class

The aggregations framework is available in the aggs.py file of the elasticsearch-dsl package. You can use the A() method to define an aggregation. There are provided classes for the supported aggregation types. A list of supported aggregation types and its provided classes are compiled in the following table. You can use the class to construct the aggregation object:

Category

Aggregation type

Provided class name

Metrics

avg

Avg

weighted_avg

WeightedAvg

cardinality

Cardinality

extended_stats

ExtendedStats

max

Max

min

Min

percentiles

Percentiles

percentile_ranks

PercentRanks

scripted_metric

ScriptedMetric

stats

Stats

sum

Sum

top_hots

TopHits ...

Get Advanced Elasticsearch 7.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.