Skip to content

Commit 6294d32

Browse files
committed
Fix indexed geo shape Field property serialization
1 parent 982fc92 commit 6294d32

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Diff for: src/Nest/DSL/Filter/GeoIndexedShapeFilterDescriptor.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface IGeoIndexedShapeFilter : IGeoShapeBaseFilter
1616
{
1717

1818
[JsonProperty("indexed_shape")]
19-
GeoIndexedShapeVector IndexedShape { get; set; }
19+
GeoIndexedShape IndexedShape { get; set; }
2020
}
2121

2222
public class GeoIndexedShapeFilter : PlainFilter, IGeoIndexedShapeFilter
@@ -28,7 +28,7 @@ protected internal override void WrapInContainer(IFilterContainer container)
2828

2929
public PropertyPathMarker Field { get; set; }
3030

31-
public GeoIndexedShapeVector IndexedShape { get; set; }
31+
public GeoIndexedShape IndexedShape { get; set; }
3232
}
3333

3434
public class GeoIndexedShapeFilterDescriptor : FilterBase, IGeoIndexedShapeFilter
@@ -43,7 +43,7 @@ bool IFilter.IsConditionless
4343
}
4444

4545
PropertyPathMarker IFieldNameFilter.Field { get; set; }
46-
GeoIndexedShapeVector IGeoIndexedShapeFilter.IndexedShape { get; set; }
46+
GeoIndexedShape IGeoIndexedShapeFilter.IndexedShape { get; set; }
4747

4848
public GeoIndexedShapeFilterDescriptor Lookup<T>(string field, string id, string index = null, string type = null)
4949
{
@@ -52,7 +52,7 @@ public GeoIndexedShapeFilterDescriptor Lookup<T>(string field, string id, string
5252

5353
private GeoIndexedShapeFilterDescriptor _SetShape<T>(PropertyPathMarker field, string id, string index, string type)
5454
{
55-
((IGeoIndexedShapeFilter)this).IndexedShape = new GeoIndexedShapeVector
55+
((IGeoIndexedShapeFilter)this).IndexedShape = new GeoIndexedShape
5656
{
5757
Field = field,
5858
Id = id,

Diff for: src/Nest/Domain/DSL/GeoIndexedShapeVector.cs renamed to src/Nest/Domain/DSL/GeoIndexedShape.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
namespace Nest
55
{
66
/// <summary>
7-
/// An object to describe a geoshape vetor
7+
/// An object to describe an indexed geoshape
88
/// http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-filter.html
99
/// </summary>
10-
public class GeoIndexedShapeVector
10+
public class GeoIndexedShape
1111
{
1212
[JsonProperty("id")]
1313
public string Id { get; set; }
@@ -18,7 +18,7 @@ public class GeoIndexedShapeVector
1818
[JsonProperty("index")]
1919
public IndexNameMarker Index { get; set; }
2020

21-
[JsonProperty("shape_field_name")]
21+
[JsonProperty("path")]
2222
public PropertyPathMarker Field { get; set; }
2323
}
2424
}

Diff for: src/Nest/Nest.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
<Compile Include="Extensions\TypeExtensions.cs" />
370370
<Compile Include="RawDispatch.generated.cs" />
371371
<Compile Include="RawDispatch.cs" />
372-
<Compile Include="Domain\DSL\GeoIndexedShapeVector.cs" />
372+
<Compile Include="Domain\DSL\GeoIndexedShape.cs" />
373373
<Compile Include="Domain\Mapping\Descriptors\CompletionMappingDescriptor.cs" />
374374
<Compile Include="Domain\Mapping\Types\CompletionMapping.cs" />
375375
<Compile Include="Domain\Responses\RootVersionInfoResponse.cs" />

Diff for: src/Nest/Resolvers/Converters/Filters/GeoShapeFilterJsonReader.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
6363
else if (indexedShape != null)
6464
{
6565
IGeoIndexedShapeFilter f = new GeoIndexedShapeFilterDescriptor();
66-
f.IndexedShape = new GeoIndexedShapeVector();
66+
f.IndexedShape = new GeoIndexedShape();
6767
var id = indexedShape["id"];
6868
var index = indexedShape["index"];
6969
var type = indexedShape["type"];
70-
var shapeField = indexedShape["shape_field_name"];
70+
var shapeField = indexedShape["path"];
7171

7272
if (id != null) f.IndexedShape.Id = id.Value<string>();
7373
if (index != null) f.IndexedShape.Index = index.Value<string>();

Diff for: src/Tests/Nest.Tests.Unit/Search/Filter/Singles/GeoIndexedShapeFilterJson.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void GeoShapeFilter()
3030
id: ""1"",
3131
type: ""elasticsearchprojects"",
3232
index: ""nest_test_data"",
33-
shape_field_name: ""myGeoShape""
33+
path: ""myGeoShape""
3434
}
3535
},
3636
_cache: true,

0 commit comments

Comments
 (0)