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

Add terms aggregation doc.

parent f7782991
No related branches found
No related tags found
No related merge requests found
# Terms Aggregation
> More info about terms aggregation is in the [official elasticsearch docs][1]
A multi-bucket value source based aggregation where buckets are dynamically
built - one per unique value.
## Simple example
```JSON
{
"aggregations" : {
"agg_genders" : {
"terms" : { "field" : "gender" }
}
}
}
```
And now the query via DSL:
```php
$termsAggregation = new TermsAggregation('genders', 'gender');
$search = new Search();
$search->addAggregation($termsAggregation);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-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