sum

Sum aggregation

/ sum, / aggregation

Sum aggregation # A single-value metrics aggregation that sums up numeric values that are extracted from the aggregated documents. Examples # Assuming the data consists of documents representing sales records we can sum the sale price of all hats with: POST /sales/_search { "query": { "constant_score": { "filter": { "match": { "type": "hat" } } } }, "aggs": { "hat_prices": { "sum": { "field": "price" } } } } Resulting in: ...