IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Value Count Aggregation Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Value Count Aggregation Usage
editFluent DSL example
edita => a .ValueCount("commit_count", c => c .Field(p => p.NumberOfCommits) )
Object Initializer syntax example
editnew ValueCountAggregation("commit_count", Field<Project>(p => p.NumberOfCommits))
Example json output.
{ "commit_count": { "value_count": { "field": "numberOfCommits" } } }
Handling Responses
editresponse.ShouldBeValid(); var commitCount = response.Aggregations.ValueCount("commit_count"); commitCount.Should().NotBeNull(); commitCount.Value.Should().BeGreaterThan(0);
Was this helpful?
Thank you for your feedback.