Geo Shape Geometry Collection Query Usage

edit

Fluent DSL example

edit
q
.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

edit
new 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,
}