-
Aivaras Gotovskis authoredAivaras Gotovskis authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Sum Aggregation
More info about sum aggregation is in the official elasticsearch docs
A single-value metrics aggregation that sums up numeric values that are extracted from the aggregated documents.
Simple example
{
"aggregations" : {
"agg_intraday_return" : { "sum" : { "field" : "change" } }
}
}
And now the query via DSL:
$sumAggregation = new SumAggregation('intraday_return', 'change');
$search = new Search();
$search->addAggregation($sumAggregation);
$queryArray = $search->toArray();