NOTE: You are looking at documentation for an older release. 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("200.0m") .ValidationMethod(GeoValidationMethod.IgnoreMalformed) )
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 = "200.0m", ValidationMethod = GeoValidationMethod.IgnoreMalformed }
Example json output.
{ "geo_distance": { "_name": "named_query", "boost": 1.1, "distance": "200.0m", "distance_type": "arc", "validation_method": "ignore_malformed", "locationPoint": { "lat": 34.0, "lon": -34.0 } } }