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

Add value count aggregation doc.

parent 6fbe00dc
No related branches found
No related tags found
No related merge requests found
# Value Count Aggregation
> More info about value count aggregation is in the [official elasticsearch docs][1]
A single-value metrics aggregation that counts the number of values that are extracted from the aggregated documents.
## Simple example
```JSON
{
"aggs" : {
"grades_count" : { "value_count" : { "field" : "grade" } }
}
}
```
And now the query via DSL:
```php
$valueCountAggregation = new ValueCountAggregation('grades_count', 'grade');
$search = new Search();
$search->addAggregation($valueCountAggregation);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-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