Geo Shape Geometry Collection Query Usage

edit

Fluent DSL example

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

Object Initializer syntax example

edit
new GeoShapeGeometryCollectionQuery
{
    Name = "named_query",
    Boost = 1.1,
    Field = Infer.Field<Project>(p => p.Location),
    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,
    IgnoreUnmapped = false
}