A newer version is available. For the latest information, see the
current release documentation.
Geo Distance Query Usage
editGeo Distance Query Usage
editFluent DSL example
editq .GeoDistance(g => g .Boost(1.1) .Name("named_query") .Field(p => p.LocationPoint) .DistanceType(GeoDistanceType.Arc) .Location(34, -34) .Distance("200m") .ValidationMethod(GeoValidationMethod.IgnoreMalformed) .IgnoreUnmapped(true) )
Object Initializer syntax example
editnew GeoDistanceQuery { Boost = 1.1, Name = "named_query", Field = Infer.Field<Project>(p => p.LocationPoint), DistanceType = GeoDistanceType.Arc, Location = new GeoLocation(34, -34), Distance = "200m", ValidationMethod = GeoValidationMethod.IgnoreMalformed, IgnoreUnmapped = true, }
Example json output.
{ "geo_distance": { "_name": "named_query", "boost": 1.1, "distance": "200m", "distance_type": "arc", "validation_method": "ignore_malformed", "locationPoint": { "lat": 34.0, "lon": -34.0 }, "ignore_unmapped": true } }