NOTE: You are looking at documentation for an older release. For the latest information, see the current release documentation.
Geo Shape Geometry Collection Query Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Geo Shape Geometry Collection Query Usage
editFluent DSL example
editq
.GeoShapeGeometryCollection(c => c
.Name("named_query")
.Boost(1.1)
.Field(p => p.LocationShape)
.Geometries(
new PointGeoShape(PointCoordinates),
new MultiPointGeoShape(MultiPointCoordinates),
new LineStringGeoShape(LineStringCoordinates),
new MultiLineStringGeoShape(MultiLineStringCoordinates),
new PolygonGeoShape(PolygonCoordinates),
new MultiPolygonGeoShape(MultiPolygonCoordinates)
)
.Relation(GeoShapeRelation.Intersects)
)
Object Initializer syntax example
editnew GeoShapeGeometryCollectionQuery
{
Name = "named_query",
Boost = 1.1,
Field = Infer.Field<Project>(p => p.LocationShape),
Shape = new Nest.GeometryCollection
{
Geometries = new IGeoShape[]
{
new PointGeoShape(PointCoordinates),
new MultiPointGeoShape(MultiPointCoordinates),
new LineStringGeoShape(LineStringCoordinates),
new MultiLineStringGeoShape(MultiLineStringCoordinates),
new PolygonGeoShape(PolygonCoordinates),
new MultiPolygonGeoShape(MultiPolygonCoordinates),
}
},
Relation = GeoShapeRelation.Intersects,
}