Skip to content

Commit

Permalink
Set obsolete warning on GeoShape properties. #3770
Browse files Browse the repository at this point in the history
  • Loading branch information
codebrain committed May 30, 2019
1 parent c9bcf09 commit 8aa17ee
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Diagnostics;
using System.Runtime.Serialization;
using Elasticsearch.Net;
Expand All @@ -24,6 +25,7 @@ public interface IGeoShapeProperty : IDocValuesProperty
/// noting that large shapes will have greater false positives.
/// </remarks>
[DataMember(Name ="distance_error_pct")]
[Obsolete("Removed in Elasticsearch 6.6")]
double? DistanceErrorPercentage { get; set; }

/// <summary>
Expand Down Expand Up @@ -64,6 +66,7 @@ public interface IGeoShapeProperty : IDocValuesProperty
/// so that geo_shape queries are optimal on a point only field.
/// </summary>
[DataMember(Name ="points_only")]
[Obsolete("Removed in Elasticsearch 6.6")]
bool? PointsOnly { get; set; }

/// <summary>
Expand All @@ -72,6 +75,7 @@ public interface IGeoShapeProperty : IDocValuesProperty
/// the best tree_levels value to honor this precision.
/// </summary>
[DataMember(Name ="precision")]
[Obsolete("Removed in Elasticsearch 6.6")]
Distance Precision { get; set; }

/// <summary>
Expand All @@ -87,6 +91,7 @@ public interface IGeoShapeProperty : IDocValuesProperty
/// Defaults to <see cref="GeoTree.Geohash" />
/// </summary>
[DataMember(Name ="tree")]
[Obsolete("Removed in Elasticsearch 6.6")]
GeoTree? Tree { get; set; }

/// <summary>
Expand All @@ -97,6 +102,7 @@ public interface IGeoShapeProperty : IDocValuesProperty
/// <see cref="Precision" /> parameter instead.
/// </summary>
[DataMember(Name ="tree_levels")]
[Obsolete("Removed in Elasticsearch 6.6")]
int? TreeLevels { get; set; }

/// <summary>
Expand All @@ -113,6 +119,7 @@ public class GeoShapeProperty : DocValuesPropertyBase, IGeoShapeProperty
public GeoShapeProperty() : base(FieldType.GeoShape) { }

/// <inheritdoc />
[Obsolete("Removed in Elasticsearch 6.6")]
public double? DistanceErrorPercentage { get; set; }

/// <inheritdoc />
Expand All @@ -125,18 +132,22 @@ public GeoShapeProperty() : base(FieldType.GeoShape) { }
public GeoOrientation? Orientation { get; set; }

/// <inheritdoc />
[Obsolete("Removed in Elasticsearch 6.6")]
public bool? PointsOnly { get; set; }

/// <inheritdoc />
[Obsolete("Removed in Elasticsearch 6.6")]
public Distance Precision { get; set; }

/// <inheritdoc />
public GeoStrategy? Strategy { get; set; }

/// <inheritdoc />
[Obsolete("Removed in Elasticsearch 6.6")]
public GeoTree? Tree { get; set; }

/// <inheritdoc />
[Obsolete("Removed in Elasticsearch 6.6")]
public int? TreeLevels { get; set; }

/// <inheritdoc />
Expand All @@ -151,38 +162,54 @@ public class GeoShapePropertyDescriptor<T>
{
public GeoShapePropertyDescriptor() : base(FieldType.GeoShape) { }


[Obsolete("Removed in Elasticsearch 6.6")]
double? IGeoShapeProperty.DistanceErrorPercentage { get; set; }
bool? IGeoShapeProperty.IgnoreMalformed { get; set; }
bool? IGeoShapeProperty.IgnoreZValue { get; set; }
GeoOrientation? IGeoShapeProperty.Orientation { get; set; }

[Obsolete("Removed in Elasticsearch 6.6")]
bool? IGeoShapeProperty.PointsOnly { get; set; }

[Obsolete("Removed in Elasticsearch 6.6")]
Distance IGeoShapeProperty.Precision { get; set; }
GeoStrategy? IGeoShapeProperty.Strategy { get; set; }

[Obsolete("Removed in Elasticsearch 6.6")]
GeoTree? IGeoShapeProperty.Tree { get; set; }

[Obsolete("Removed in Elasticsearch 6.6")]
int? IGeoShapeProperty.TreeLevels { get; set; }
bool? IGeoShapeProperty.Coerce { get; set; }

/// <inheritdoc cref="IGeoShapeProperty.Tree" />

[Obsolete("Removed in Elasticsearch 6.6")]
public GeoShapePropertyDescriptor<T> Tree(GeoTree? tree) => Assign(tree, (a, v) => a.Tree = v);

/// <inheritdoc cref="IGeoShapeProperty.TreeLevels" />
[Obsolete("Removed in Elasticsearch 6.6")]
public GeoShapePropertyDescriptor<T> TreeLevels(int? treeLevels) => Assign(treeLevels, (a, v) => a.TreeLevels = v);

/// <inheritdoc cref="IGeoShapeProperty.Strategy" />
public GeoShapePropertyDescriptor<T> Strategy(GeoStrategy? strategy) => Assign(strategy, (a, v) => a.Strategy = v);

/// <inheritdoc cref="IGeoShapeProperty.Precision" />
[Obsolete("Removed in Elasticsearch 6.6")]
public GeoShapePropertyDescriptor<T> Precision(double precision, DistanceUnit unit) =>
Assign(new Distance(precision, unit), (a, v) => a.Precision = v);

/// <inheritdoc cref="IGeoShapeProperty.Orientation" />
public GeoShapePropertyDescriptor<T> Orientation(GeoOrientation? orientation) => Assign(orientation, (a, v) => a.Orientation = v);

/// <inheritdoc cref="IGeoShapeProperty.DistanceErrorPercentage" />
[Obsolete("Removed in Elasticsearch 6.6")]
public GeoShapePropertyDescriptor<T> DistanceErrorPercentage(double? distanceErrorPercentage) =>
Assign(distanceErrorPercentage, (a, v) => a.DistanceErrorPercentage = v);

/// <inheritdoc cref="IGeoShapeProperty.PointsOnly" />
[Obsolete("Removed in Elasticsearch 6.6")]
public GeoShapePropertyDescriptor<T> PointsOnly(bool? pointsOnly = true) => Assign(pointsOnly, (a, v) => a.PointsOnly = v);

/// <inheritdoc cref="IGeoShapeProperty.IgnoreMalformed" />
Expand Down

0 comments on commit 8aa17ee

Please sign in to comment.