Skip to content

Commit 1a39a5a

Browse files
committed
Merge branch 'feature/5.x-geometrycollection' into 5.x
2 parents bfaccbd + fe41648 commit 1a39a5a

File tree

21 files changed

+595
-70
lines changed

21 files changed

+595
-70
lines changed

docs/query-dsl-usage.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ include::query-dsl/geo/shape/circle/geo-shape-circle-usage.asciidoc[]
5252

5353
include::query-dsl/geo/shape/envelope/geo-envelope-usage.asciidoc[]
5454

55+
include::query-dsl/geo/shape/geometry-collection/geo-geometry-collection-usage.asciidoc[]
56+
5557
include::query-dsl/geo/shape/indexed-shape/geo-indexed-shape-usage.asciidoc[]
5658

5759
include::query-dsl/geo/shape/line-string/geo-line-string-usage.asciidoc[]
@@ -60,6 +62,8 @@ include::query-dsl/geo/shape/multi-line-string/geo-multi-line-string-usage.ascii
6062

6163
include::query-dsl/geo/shape/multi-point/geo-multi-point-usage.asciidoc[]
6264

65+
include::query-dsl/geo/shape/multi-polygon/geo-multi-polygon-usage.asciidoc[]
66+
6367
include::query-dsl/geo/shape/point/geo-point-usage.asciidoc[]
6468

6569
include::query-dsl/geo/shape/polygon/geo-polygon-usage.asciidoc[]

docs/query-dsl.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ NEST exposes all of the query DSL endpoints available in Elasticsearch
5959

6060
* <<geo-envelope-usage,Geo Envelope Usage>>
6161

62+
* <<geo-geometry-collection-usage,Geo Geometry Collection Usage>>
63+
6264
* <<geo-indexed-shape-usage,Geo Indexed Shape Usage>>
6365

6466
* <<geo-line-string-usage,Geo Line String Usage>>
@@ -67,6 +69,8 @@ NEST exposes all of the query DSL endpoints available in Elasticsearch
6769

6870
* <<geo-multi-point-usage,Geo Multi Point Usage>>
6971

72+
* <<geo-multi-polygon-usage,Geo Multi Polygon Usage>>
73+
7074
* <<geo-point-usage,Geo Point Usage>>
7175

7276
* <<geo-polygon-usage,Geo Polygon Usage>>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/5.0
2+
3+
:github: https://github.com/elastic/elasticsearch-net
4+
5+
:nuget: https://www.nuget.org/packages
6+
7+
////
8+
IMPORTANT NOTE
9+
==============
10+
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/5.x/src/Tests/QueryDsl/Geo/Shape/GeometryCollection/GeoGeometryCollectionUsageTests.cs.
11+
If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,
12+
please modify the original csharp file found at the link and submit the PR with that change. Thanks!
13+
////
14+
15+
[[geo-geometry-collection-usage]]
16+
== Geo Geometry Collection Usage
17+
18+
=== Fluent DSL Example
19+
20+
[source,csharp]
21+
----
22+
q
23+
.GeoShapeGeometryCollection(c => c
24+
.Name("named_query")
25+
.Boost(1.1)
26+
.Field(p=>p.Location)
27+
.Geometries(
28+
new PointGeoShape(this._pointCoordinates),
29+
new MultiPointGeoShape(this._multiPointCoordinates),
30+
new LineStringGeoShape(this._lineStringCoordinates),
31+
new MultiLineStringGeoShape(this._multiLineStringCoordinates),
32+
new PolygonGeoShape(this._polygonCoordinates),
33+
new MultiPolygonGeoShape(this._multiPolygonCoordinates)
34+
)
35+
.Relation(GeoShapeRelation.Intersects)
36+
.IgnoreUnmapped()
37+
)
38+
----
39+
40+
=== Object Initializer Syntax Example
41+
42+
[source,csharp]
43+
----
44+
new GeoShapeGeometryCollectionQuery
45+
{
46+
Name = "named_query",
47+
Boost = 1.1,
48+
Field = Infer.Field<Project>(p=>p.Location),
49+
Shape = new Nest.GeometryCollection
50+
{
51+
Geometries = new IGeoShape[]
52+
{
53+
new PointGeoShape(this._pointCoordinates),
54+
new MultiPointGeoShape(this._multiPointCoordinates),
55+
new LineStringGeoShape(this._lineStringCoordinates),
56+
new MultiLineStringGeoShape(_multiLineStringCoordinates),
57+
new PolygonGeoShape(this._polygonCoordinates),
58+
new MultiPolygonGeoShape(this._multiPolygonCoordinates),
59+
}
60+
},
61+
Relation = GeoShapeRelation.Intersects,
62+
IgnoreUnmapped = false
63+
}
64+
----
65+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/5.0
2+
3+
:github: https://github.com/elastic/elasticsearch-net
4+
5+
:nuget: https://www.nuget.org/packages
6+
7+
////
8+
IMPORTANT NOTE
9+
==============
10+
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/5.x/src/Tests/QueryDsl/Geo/Shape/MultiPolygon/GeoMultiPolygonUsageTests.cs.
11+
If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,
12+
please modify the original csharp file found at the link and submit the PR with that change. Thanks!
13+
////
14+
15+
[[geo-multi-polygon-usage]]
16+
== Geo Multi Polygon Usage
17+
18+
=== Fluent DSL Example
19+
20+
[source,csharp]
21+
----
22+
q
23+
.GeoShapeMultiPolygon(c => c
24+
.Name("named_query")
25+
.Boost(1.1)
26+
.Field(p => p.Location)
27+
.Coordinates(this._coordinates)
28+
.Relation(GeoShapeRelation.Intersects)
29+
.IgnoreUnmapped()
30+
)
31+
----
32+
33+
=== Object Initializer Syntax Example
34+
35+
[source,csharp]
36+
----
37+
new GeoShapeMultiPolygonQuery
38+
{
39+
Name = "named_query",
40+
Boost = 1.1,
41+
Field = Field<Project>(p => p.Location),
42+
Shape = new MultiPolygonGeoShape(this._coordinates),
43+
Relation = GeoShapeRelation.Intersects,
44+
IgnoreUnmapped = false
45+
}
46+
----
47+

src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ public PutMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int maxR
145145
/// <inheritdoc/>
146146
public PutMappingDescriptor<T> Parent<TParent>() where TParent : class => Assign(a => a.ParentField = new ParentField { Type = typeof(TParent) });
147147

148+
#pragma warning disable 618
148149
/// <inheritdoc/>
149150
public PutMappingDescriptor<T> Analyzer(string analyzer) => Assign(a => a.Analyzer = analyzer);
150151

151152
/// <inheritdoc/>
152153
public PutMappingDescriptor<T> SearchAnalyzer(string searchAnalyzer) => Assign(a => a.SearchAnalyzer = searchAnalyzer);
154+
#pragma warning restore 618
153155

154156
/// <inheritdoc/>
155157
public PutMappingDescriptor<T> AllField(Func<AllFieldDescriptor, IAllField> allFieldSelector) => Assign(a => a.AllField = allFieldSelector?.Invoke(new AllFieldDescriptor()));

src/Nest/Nest.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,8 @@
10781078
<Compile Include="QueryDsl\Geo\Shape\Circle\GeoShapeCircleQuery.cs" />
10791079
<Compile Include="QueryDsl\Geo\Shape\Envelope\EnvelopeGeoShape.cs" />
10801080
<Compile Include="QueryDsl\Geo\Shape\Envelope\GeoShapeEnvelopeQuery.cs" />
1081+
<Compile Include="QueryDsl\Geo\Shape\GeometryCollection\GeometryCollection.cs" />
1082+
<Compile Include="QueryDsl\Geo\Shape\GeometryCollection\GeoShapeGeometryCollectionQuery.cs" />
10811083
<Compile Include="QueryDsl\Geo\Shape\GeoShapeBase.cs" />
10821084
<Compile Include="QueryDsl\Geo\Shape\GeoShapeQueryJsonConverter.cs" />
10831085
<Compile Include="QueryDsl\Geo\Shape\IGeoShapeQuery.cs" />

0 commit comments

Comments
 (0)