Geo Shape Geometry Collection Query Usageedit

Fluent DSL exampleedit

q
.GeoShapeGeometryCollection(c => c
    .Name("named_query")
    .Boost(1.1)
    .Field(p=>p.Location)
    .Geometries(
        new PointGeoShape(this._pointCoordinates),
        new MultiPointGeoShape(this._multiPointCoordinates),
        new LineStringGeoShape(this._lineStringCoordinates),
        new MultiLineStringGeoShape(this._multiLineStringCoordinates),
        new PolygonGeoShape(this._polygonCoordinates),
        new MultiPolygonGeoShape(this._multiPolygonCoordinates)
    )
    .Relation(GeoShapeRelation.Intersects)
    .IgnoreUnmapped()
)

Object Initializer syntax exampleedit

new GeoShapeGeometryCollectionQuery
{
    Name = "named_query",
    Boost = 1.1,
    Field = Infer.Field<Project>(p=>p.Location),
    Shape = new Nest.GeometryCollection
    {
        Geometries = new IGeoShape[]
        {
            new PointGeoShape(this._pointCoordinates),
            new MultiPointGeoShape(this._multiPointCoordinates),
            new LineStringGeoShape(this._lineStringCoordinates),
            new MultiLineStringGeoShape(_multiLineStringCoordinates),
            new PolygonGeoShape(this._polygonCoordinates),
            new MultiPolygonGeoShape(this._multiPolygonCoordinates),
        }
    },
    Relation = GeoShapeRelation.Intersects,
    IgnoreUnmapped = false
}