WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. 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.Location) .DistanceType(GeoDistanceType.Arc) .Coerce() .Location(34, -34) .Distance("200.0m") .IgnoreMalformed() .Optimize(GeoOptimizeBBox.Memory) .ValidationMethod(GeoValidationMethod.Strict) )
Object Initializer syntax example
editnew GeoDistanceQuery { Boost = 1.1, Name = "named_query", Field = Infer.Field<Project>(p => p.Location), DistanceType = GeoDistanceType.Arc, Coerce = true, Location = new GeoLocation(34,-34), Distance = "200.0m", IgnoreMalformed = true, OptimizeBoundingBox = GeoOptimizeBBox.Memory, ValidationMethod = GeoValidationMethod.Strict }
Example json output.
{ "geo_distance": { "_name": "named_query", "boost": 1.1, "distance": "200.0m", "optimize_bbox": "memory", "distance_type": "arc", "coerce": true, "ignore_malformed": true, "validation_method": "strict", "location": { "lat": 34.0, "lon": -34.0 } } }