Geo Hash Cell Query Usage

edit

Fluent DSL example

edit
q
.GeoHashCell(c => c
    .Name("named_query")
    .Boost(1.1)
    .Field(p => p.Location)
    .Location(new GeoLocation(13.4080, 52.5186))
    .Neighbors()
    .Precision(Nest.Distance.Meters(3))
)

Object Initializer syntax example

edit
new GeoHashCellQuery
{
    Boost = 1.1,
    Name = "named_query",
    Field = Infer.Field<Project>(p => p.Location),
    Location = new GeoLocation(13.4080, 52.5186),
    Neighbors = true,
    Precision = Nest.Distance.Meters(3)
}

Example json output.

{
  "geohash_cell": {
    "_name": "named_query",
    "boost": 1.1,
    "precision": "3.0m",
    "neighbors": true,
    "location": {
      "lat": 13.408,
      "lon": 52.5186
    }
  }
}