Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set obsolete warning on GeoShape properties. #3770

Merged
merged 1 commit into from
May 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Newtonsoft.Json;

Expand All @@ -23,6 +24,7 @@ public interface IGeoShapeProperty : IDocValuesProperty
/// noting that large shapes will have greater false positives.
/// </remarks>
[JsonProperty("distance_error_pct")]
[Obsolete("Removed in Elasticsearch 6.6")]
double? DistanceErrorPercentage { get; set; }

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

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

/// <summary>
Expand All @@ -85,6 +89,7 @@ public interface IGeoShapeProperty : IDocValuesProperty
/// Name of the PrefixTree implementation to be used.
/// Defaults to <see cref="GeoTree.Geohash" />
/// </summary>
[Obsolete("Removed in Elasticsearch 6.6")]
[JsonProperty("tree")]
GeoTree? Tree { get; set; }

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

/// <summary>
Expand All @@ -112,6 +118,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 @@ -124,18 +131,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 @@ -150,39 +161,55 @@ 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