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

Add Histogram aggregation doc.

parent d720d65d
No related branches found
No related tags found
No related merge requests found
# Histogram Aggregation
> More info about histogram aggregation is in the [official elasticsearch docs][1]
A multi-bucket values source based aggregation that can be applied on numeric values extracted from
the documents. It dynamically builds fixed size (a.k.a. interval) buckets over the values.
## Simple example
```JSON
{
"aggregations": {
"agg_prices": {
"histogram": {
"field": "price",
"interval": 50
}
}
}
}
```
And now the query via DSL:
```php
$histogramAggregation = new HistogramAggregation('prices', 'price', 50);
$search = new Search();
$search->addAggregation($histogramAggregation);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-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