Missing Aggregation Usageedit

Fluent DSL exampleedit

s => s
.Aggregations(a => a
    .Missing("projects_without_a_description", m => m
        .Field(p => p.Description)
    )
)

Object Initializer syntax exampleedit

new SearchRequest<Project>
{
    Aggregations = new MissingAggregation("projects_without_a_description")
    {
        Field = Field<Project>(p => p.Description)
    }
}

Example json output.

{
  "aggs": {
    "projects_without_a_description": {
      "missing": {
        "field": "description"
      }
    }
  }
}

Handling Responsesedit

response.ShouldBeValid();
var projectsWithoutDesc = response.Aggs.Missing("projects_without_a_description");
projectsWithoutDesc.Should().NotBeNull();