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 Bounding Box Query Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Geo Bounding Box Query Usage
editFluent DSL example
editq .GeoBoundingBox(g=>g .Boost(1.1) .Name("named_query") .Field(p=>p.Location) .BoundingBox(b=>b .TopLeft(34, -34) .BottomRight(-34, 34) ) .Coerce() .IgnoreMalformed() .ValidationMethod(GeoValidationMethod.Strict) .Type(GeoExecution.Indexed) )
Object Initializer syntax example
editnew GeoBoundingBoxQuery { Boost = 1.1, Name = "named_query", Field = Infer.Field<Project>(p => p.Location), BoundingBox = new Nest.BoundingBox { TopLeft = new GeoLocation(34,-34), BottomRight = new GeoLocation(-34,34), }, Type = GeoExecution.Indexed, Coerce = true, IgnoreMalformed = true, ValidationMethod = GeoValidationMethod.Strict }
Example json output.
{ "geo_bounding_box": { "type": "indexed", "coerce": true, "ignore_malformed": true, "validation_method": "strict", "_name": "named_query", "boost": 1.1, "location": { "top_left": { "lat": 34.0, "lon": -34.0 }, "bottom_right": { "lat": -34.0, "lon": 34.0 } } } }
Was this helpful?
Thank you for your feedback.