IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Sum Aggregation Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Sum Aggregation Usage
editFluent DSL example
edita => a .Sum("commits_sum", sm => sm .Field(p => p.NumberOfCommits) )
Object Initializer syntax example
editnew SumAggregation("commits_sum", Field<Project>(p => p.NumberOfCommits))
Example json output.
{ "commits_sum": { "sum": { "field": "numberOfCommits" } } }
Handling Responses
editresponse.ShouldBeValid(); var commitsSum = response.Aggregations.Sum("commits_sum"); commitsSum.Should().NotBeNull(); commitsSum.Value.Should().BeGreaterThan(0);