diff --git a/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeAttribute.cs b/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeAttribute.cs index 15dd1df5bee..ef3cb1ee8f8 100644 --- a/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeAttribute.cs +++ b/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeAttribute.cs @@ -15,6 +15,7 @@ public GeoShapeAttribute() : base(FieldType.GeoShape) { } double? IGeoShapeProperty.DistanceErrorPercentage { get; set; } bool? IGeoShapeProperty.PointsOnly { get; set; } bool? IGeoShapeProperty.IgnoreMalformed { get; set; } + bool? IGeoShapeProperty.IgnoreZValue { get; set; } /// public GeoTree Tree { get => Self.Tree.GetValueOrDefault(GeoTree.Geohash); set => Self.Tree = value; } @@ -36,5 +37,7 @@ public double DistanceErrorPercentage public bool PointsOnly { get => Self.PointsOnly.GetValueOrDefault(false); set => Self.PointsOnly = value; } /// public bool IgnoreMalformed { get => Self.IgnoreMalformed.GetValueOrDefault(false); set => Self.IgnoreMalformed = value; } + /// + public bool IgnoreZValue { get => Self.IgnoreZValue.GetValueOrDefault(true); set => Self.IgnoreZValue = value; } } } diff --git a/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs b/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs index a1717fa3163..aefbf6fb46b 100644 --- a/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs +++ b/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs @@ -85,6 +85,18 @@ public interface IGeoShapeProperty : IDocValuesProperty /// [JsonProperty("ignore_malformed")] bool? IgnoreMalformed { get; set; } + + /// + /// If true (default) three dimension points will be accepted (stored in source) but + /// only latitude and longitude values will be indexed; the third dimension is ignored. If false, + /// geo-points containing any more than latitude and longitude (two dimensions) values throw + /// an exception and reject the whole document. + /// + /// + /// Valid for Elasticsearch 6.3.0+ + /// + [JsonProperty("ignore_z_value")] + bool? IgnoreZValue { get; set; } } /// @@ -116,6 +128,9 @@ public GeoShapeProperty() : base(FieldType.GeoShape) { } /// public bool? IgnoreMalformed { get; set; } + + /// + public bool? IgnoreZValue { get; set; } } /// @@ -132,6 +147,7 @@ public class GeoShapePropertyDescriptor double? IGeoShapeProperty.DistanceErrorPercentage { get; set; } bool? IGeoShapeProperty.PointsOnly { get; set; } bool? IGeoShapeProperty.IgnoreMalformed { get; set; } + bool? IGeoShapeProperty.IgnoreZValue { get; set; } public GeoShapePropertyDescriptor() : base(FieldType.GeoShape) { } @@ -161,5 +177,9 @@ public GeoShapePropertyDescriptor DistanceErrorPercentage(double? distanceErr /// public GeoShapePropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) => Assign(a => a.IgnoreMalformed = ignoreMalformed); + + /// + public GeoShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) => + Assign(a => a.IgnoreZValue = ignoreZValue); } }