Geo Distance Range Query Usageedit

Fluent DSL exampleedit

q
.GeoDistanceRange(g=>g
    .Boost(1.1)
    .Name("named_query")
    .Field(p=>p.Location)
    .DistanceType(GeoDistanceType.Arc)
    .GreaterThanOrEqualTo(200, DistanceUnit.Kilometers)
    .GreaterThan(200, DistanceUnit.Kilometers)
    .Location(new GeoLocation(40, -70))
    .Optimize(GeoOptimizeBBox.Indexed)
    .LessThanOrEqualTo(Nest.Distance.Miles(400))
    .LessThan(Nest.Distance.Miles(400))
    .ValidationMethod(GeoValidationMethod.Strict)
)

Object Initializer syntax exampleedit

new GeoDistanceRangeQuery
{
    Boost = 1.1,
    Name = "named_query",
    Field = Infer.Field<Project>(p=>p.Location),
    DistanceType = GeoDistanceType.Arc,
    GreaterThanOrEqualTo = Nest.Distance.Kilometers(200),
    GreaterThan = Nest.Distance.Kilometers(200),
    LessThan = Nest.Distance.Miles(400),
    Location = new GeoLocation(40, -70),
    OptimizeBoundingBox = GeoOptimizeBBox.Indexed,
    LessThanOrEqualTo = Nest.Distance.Miles(400),
    ValidationMethod = GeoValidationMethod.Strict
}

Example json output. 

{
  "geo_distance_range": {
    "gt": "200.0km",
    "gte": "200.0km",
    "lt": "400.0mi",
    "lte": "400.0mi",
    "distance_type": "arc",
    "optimize_bbox": "indexed",
    "validation_method": "strict",
    "_name": "named_query",
    "boost": 1.1,
    "location": {
      "lat": 40.0,
      "lon": -70.0
    }
  }
}