Skip to content

Commit

Permalink
Mark version property on Analyzer as obsolete (#5815)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon authored Jul 6, 2021
1 parent b868ebd commit 4aa1adb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Nest/Analysis/Analyzers/AnalyzerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System;
using System.Runtime.Serialization;
using Elasticsearch.Net.Utf8Json;

Expand All @@ -13,7 +14,12 @@ public interface IAnalyzer
[DataMember(Name = "type")]
string Type { get; }

/// <summary>
/// Setting a version on analysis component has no effect and is deprecated.
/// This setting will be removed in v8.0.
/// </summary>
[DataMember(Name = "version")]
[Obsolete("Setting a version on analysis component has no effect and is deprecated.")]
string Version { get; set; }
}

Expand All @@ -26,6 +32,8 @@ internal AnalyzerBase() { }

public virtual string Type { get; protected set; }

/// <inheritdoc cref="IAnalyzer.Version" />
[Obsolete("Setting a version on analysis component has no effect and is deprecated.")]
public string Version { get; set; }
}

Expand All @@ -38,6 +46,8 @@ public abstract class AnalyzerDescriptorBase<TAnalyzer, TAnalyzerInterface>
string IAnalyzer.Type => Type;
string IAnalyzer.Version { get; set; }

/// <inheritdoc cref="IAnalyzer.Version" />
[Obsolete("Setting a version on analysis component has no effect and is deprecated.")]
public TAnalyzer Version(string version) => Assign(version, (a, v) => a.Version = v);
}
}

0 comments on commit 4aa1adb

Please sign in to comment.