Max Aggregation Usage

edit

Fluent DSL example

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

Object Initializer syntax example

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

Example json output.

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

Handling Responses

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