Max Aggregation Usageedit

Fluent DSL exampleedit

a => a
.Max("max_commits", m => m
    .Field(p => p.NumberOfCommits)
)

Object Initializer syntax exampleedit

new MaxAggregation("max_commits", Field<Project>(p => p.NumberOfCommits))

Example json output. 

{
  "max_commits": {
    "max": {
      "field": "numberOfCommits"
    }
  }
}

Handling Responsesedit

response.ShouldBeValid();
var max = response.Aggregations.Max("max_commits");
max.Should().NotBeNull();
max.Value.Should().BeGreaterThan(0);