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 Polygon Query Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Geo Polygon Query Usage
editFluent DSL example
editq .GeoPolygon(c => c .Name("named_query") .Boost(1.1) .Field(p=>p.Location) .IgnoreMalformed() .Coerce() .ValidationMethod(GeoValidationMethod.Strict) .Points( new GeoLocation(45,-45), new GeoLocation(-34,34)) )
Object Initializer syntax example
editnew GeoPolygonQuery { Boost = 1.1, Name = "named_query", ValidationMethod = GeoValidationMethod.Strict, Coerce = true, IgnoreMalformed = true, Points = new [] { new GeoLocation(45,-45), new GeoLocation(-34,34), }, Field = Field<Project>(p=>p.Location) }
Example json output.
{ "geo_polygon": { "_name": "named_query", "boost": 1.1, "coerce": true, "ignore_malformed": true, "validation_method": "strict", "location": { "points": [ { "lat": 45.0, "lon": -45.0 }, { "lat": -34.0, "lon": 34.0 } ] } } }