Skip to content
Snippets Groups Projects
Commit f7782991 authored by Aivaras Gotovskis's avatar Aivaras Gotovskis
Browse files

Add sum aggregation doc.

parent 19cc712d
No related branches found
No related tags found
No related merge requests found
# Sum Aggregation
> More info about sum aggregation is in the [official elasticsearch docs][1]
A single-value metrics aggregation that sums up numeric values that are extracted from the aggregated documents.
## Simple example
```JSON
{
"aggregations" : {
"agg_intraday_return" : { "sum" : { "field" : "change" } }
}
}
```
And now the query via DSL:
```php
$sumAggregation = new SumAggregation('intraday_return', 'change');
$search = new Search();
$search->addAggregation($sumAggregation);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-sum-aggregation.html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment