Skip to content

Commit cb2acff

Browse files
committed
Merge branch 'feature/2.x-mark-obsolete' into 2.x
2 parents 63ca902 + add1a4f commit cb2acff

File tree

48 files changed

+209
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+209
-102
lines changed

src/Benchmarking/Options.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ public Func<string, string> MessageLocalizer
544544
protected override string GetKeyForItem(Option item)
545545
{
546546
if (item == null)
547-
throw new ArgumentNullException("option");
547+
throw new ArgumentNullException(nameof(item));
548548
if (item.Names != null && item.Names.Length > 0)
549549
return item.Names[0];
550550
// This should never happen, as it's invalid for Option to be
@@ -556,7 +556,7 @@ protected override string GetKeyForItem(Option item)
556556
protected Option GetOptionForName(string option)
557557
{
558558
if (option == null)
559-
throw new ArgumentNullException("option");
559+
throw new ArgumentNullException(nameof(option));
560560
try
561561
{
562562
return base[option];

src/Elasticsearch.Net/Configuration/Security/BasicAuthenticationCredentials.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Elasticsearch.Net
55
public class BasicAuthenticationCredentials
66
{
77
public string Username { get; set; }
8-
[Obsolete("Scheduled to be removed use Username instead, note the lowercase n")]
8+
[Obsolete("Removed in 5.0.0. Use Username instead, note the lowercase n")]
99
[CLSCompliant(false)]
1010
public string UserName { get { return Username; } set { Username = value; } }
1111
public string Password { get; set; }

src/Elasticsearch.Net/Transport/Pipeline/RequestData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class RequestData
4444
public IConnectionConfigurationValues ConnectionSettings { get; }
4545
public IMemoryStreamFactory MemoryStreamFactory { get; }
4646

47-
[Obsolete("this constructor is scheduled to be removed in the next major version")]
47+
[Obsolete("Removed in 5.0.0")]
4848
public RequestData(HttpMethod method, string path, PostData<object> data, IConnectionConfigurationValues global, IMemoryStreamFactory memoryStreamFactory)
4949
#pragma warning disable CS0618 // Type or member is obsolete
5050
: this(method, path, data, global, (IRequestConfiguration)null, memoryStreamFactory)
@@ -60,7 +60,7 @@ public RequestData(HttpMethod method, string path, PostData<object> data, IConne
6060
this.Path = this.CreatePathWithQueryStrings(path, this.ConnectionSettings, local);
6161
}
6262

63-
[Obsolete("this constructor is scheduled to become private in the next major version")]
63+
[Obsolete("This constructor is scheduled to become private in 5.0.0")]
6464
public RequestData(HttpMethod method, string path, PostData<object> data, IConnectionConfigurationValues global, IRequestConfiguration local, IMemoryStreamFactory memoryStreamFactory)
6565
{
6666
this.ConnectionSettings = global;

src/Nest/Cat/CatNodeAttributes/CatNodeAttributesRequest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
namespace Nest
55
{
6-
[Obsolete("Scheduled to be removed in 5.0. Use ICatNodeAttributesRequest instead.")]
6+
[Obsolete("Scheduled to be removed in 5.0.0. Use ICatNodeAttributesRequest instead.")]
77
public partial interface ICatNodeattrsRequest { }
88

9-
[Obsolete("Scheduled to be removed in 5.0. Use CatNodeAttributesRequest instead.")]
9+
[Obsolete("Scheduled to be removed in 5.0.0. Use CatNodeAttributesRequest instead.")]
1010
public partial class CatNodeattrsRequest { }
1111

12-
[Obsolete("Scheduled to be removed in 5.0. Use CatNodeAttributesDescriptor instead.")]
12+
[Obsolete("Scheduled to be removed in 5.0.0. Use CatNodeAttributesDescriptor instead.")]
1313
public partial class CatNodeattrsDescriptor { }
1414

1515
// TODO add the following as attribute when we remove the obsolete version

src/Nest/CommonAbstractions/ConnectionSettings/ConnectionSettingsBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public ConnectionSettings(IConnectionPool connectionPool, Func<ConnectionSetting
3030
#pragma warning restore CS0618 // Type or member is obsolete
3131

3232
public ConnectionSettings(IConnectionPool connectionPool, IConnection connection, ISerializerFactory serializerFactory)
33-
: base(connectionPool, connection, serializerFactory, s => serializerFactory.Create(s)) { }
33+
: base(connectionPool, connection, serializerFactory, serializerFactory.Create) { }
3434

3535
[Obsolete("Please use the constructor taking ISerializerFactory instead of a Func")]
3636
public ConnectionSettings(IConnectionPool connectionPool, IConnection connection, Func<ConnectionSettings, IElasticsearchSerializer> serializerFactory)

src/Nest/Indices/AliasManagement/GetAliases/ElasticClient-GetAliases.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,45 @@ public partial interface IElasticClient
1515
/// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html#alias-retrieving
1616
/// </summary>
1717
/// <param name="selector">A descriptor that describes which aliases/indexes we are interested int</param>
18-
[Obsolete("Deprecated since 1.0, will be removed in 5.0. Use GetAlias which accepts multiple aliases and indices")]
18+
[Obsolete("Deprecated since 1.0.0, will be removed in 5.0.0. Use GetAlias which accepts multiple aliases and indices")]
1919
IGetAliasesResponse GetAliases(Func<GetAliasesDescriptor, IGetAliasesRequest> selector = null);
2020

2121
/// <inheritdoc/>
22-
[Obsolete("Deprecated since 1.0, will be removed in 5.0. Use GetAlias which accepts multiple aliases and indices")]
22+
[Obsolete("Deprecated since 1.0.0, will be removed in 5.0.0. Use GetAlias which accepts multiple aliases and indices")]
2323
IGetAliasesResponse GetAliases(IGetAliasesRequest request);
2424

2525
/// <inheritdoc/>
26-
[Obsolete("Deprecated since 1.0, will be removed in 5.0. Use GetAlias which accepts multiple aliases and indices")]
26+
[Obsolete("Deprecated since 1.0.0, will be removed in 5.0.0. Use GetAlias which accepts multiple aliases and indices")]
2727
Task<IGetAliasesResponse> GetAliasesAsync(Func<GetAliasesDescriptor, IGetAliasesRequest> selector = null);
2828

2929
/// <inheritdoc/>
30-
[Obsolete("Deprecated since 1.0, will be removed in 5.0. Use GetAlias which accepts multiple aliases and indices")]
30+
[Obsolete("Deprecated since 1.0.0, will be removed in 5.0.0. Use GetAlias which accepts multiple aliases and indices")]
3131
Task<IGetAliasesResponse> GetAliasesAsync(IGetAliasesRequest request);
3232

3333
}
3434

3535
public partial class ElasticClient
3636
{
3737
/// <inheritdoc/>
38-
[Obsolete("Deprecated since 1.0, will be removed in 5.0. Use GetAlias which accepts multiple aliases and indices")]
38+
[Obsolete("Deprecated since 1.0.0, will be removed in 5.0.0. Use GetAlias which accepts multiple aliases and indices")]
3939
public IGetAliasesResponse GetAliases(Func<GetAliasesDescriptor, IGetAliasesRequest> selector = null) =>
4040
this.GetAliases(selector.InvokeOrDefault(new GetAliasesDescriptor()));
4141

4242
/// <inheritdoc/>
43-
[Obsolete("Deprecated since 1.0, will be removed in 5.0. Use GetAlias which accepts multiple aliases and indices")]
43+
[Obsolete("Deprecated since 1.0.0, will be removed in 5.0.0. Use GetAlias which accepts multiple aliases and indices")]
4444
public IGetAliasesResponse GetAliases(IGetAliasesRequest request) =>
4545
this.Dispatcher.Dispatch<IGetAliasesRequest, GetAliasesRequestParameters, GetAliasesResponse>(
4646
request,
4747
(p, d) => this.LowLevelDispatch.IndicesGetAliasesDispatch<GetAliasesResponse>(p)
4848
);
4949

5050
/// <inheritdoc/>
51-
[Obsolete("Deprecated since 1.0, will be removed in 5.0. Use GetAlias which accepts multiple aliases and indices")]
51+
[Obsolete("Deprecated since 1.0.0, will be removed in 5.0.0. Use GetAlias which accepts multiple aliases and indices")]
5252
public Task<IGetAliasesResponse> GetAliasesAsync(Func<GetAliasesDescriptor, IGetAliasesRequest> selector = null) =>
5353
this.GetAliasesAsync(selector.InvokeOrDefault(new GetAliasesDescriptor()));
5454

5555
/// <inheritdoc/>
56-
[Obsolete("Deprecated since 1.0, will be removed in 5.0. Use GetAlias which accepts multiple aliases and indices")]
56+
[Obsolete("Deprecated since 1.0.0, will be removed in 5.0.0. Use GetAlias which accepts multiple aliases and indices")]
5757
public Task<IGetAliasesResponse> GetAliasesAsync(IGetAliasesRequest request) =>
5858
this.Dispatcher.DispatchAsync<IGetAliasesRequest, GetAliasesRequestParameters, GetAliasesResponse, IGetAliasesResponse>(
5959
request,

src/Nest/Indices/Analyze/AnalyzeRequest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial interface IAnalyzeRequest
1414
string Analyzer { get; set; }
1515

1616
///<summary>A collection of character filters to use for the analysis</summary>
17-
[Obsolete("Deprecated in 2.4.0. Will be removed in 5.0. Use CharFilter instead")]
17+
[Obsolete("Deprecated in 2.4.0. Removed in 5.0.0. Use CharFilter instead")]
1818
[JsonIgnore]
1919
string[] CharFilters { get; set; }
2020

@@ -31,7 +31,7 @@ public partial interface IAnalyzeRequest
3131
Field Field { get; set; }
3232

3333
///<summary>A collection of filters to use for the analysis</summary>
34-
[Obsolete("Deprecated in 2.4.0. Will be removed in 5.0. Use Filter instead")]
34+
[Obsolete("Deprecated in 2.4.0. Removed in 5.0.0. Use Filter instead")]
3535
[JsonIgnore]
3636
string[] Filters { get; set; }
3737

@@ -56,7 +56,7 @@ public AnalyzeRequest(IndexName indices, string textToAnalyze)
5656
public string Analyzer { get; set; }
5757

5858
///<summary>A collection of character filters to use for the analysis</summary>
59-
[Obsolete("Will be removed in 5.0. Use CharFilter instead")]
59+
[Obsolete("Deprecated in 2.4.0. Removed in 5.0.0. Use CharFilter instead")]
6060
public string[] CharFilters { get { return CharFilter; } set { CharFilter = value; } }
6161

6262
///<summary>A collection of character filters to use for the analysis</summary>
@@ -69,7 +69,7 @@ public AnalyzeRequest(IndexName indices, string textToAnalyze)
6969
public Field Field { get; set; }
7070

7171
///<summary>A collection of filters to use for the analysis</summary>
72-
[Obsolete("Will be removed in 5.0. Use Filter instead")]
72+
[Obsolete("Deprecated in 2.4.0. Removed in 5.0.0. Use Filter instead")]
7373
public string[] Filters { get { return Filter; } set { Filter = value; } }
7474

7575
///<summary>The text on which the analysis should be performed</summary>

src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ internal PutMappingRequest() { }
5151

5252
#pragma warning disable 618
5353
/// <inheritdoc/>
54-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
54+
[Obsolete("Deprecated in 2.0.0 Removed in 5.0.0")]
5555
public IList<IMappingTransform> Transform { get; set; }
5656

5757
/// <inheritdoc/>
5858
[Obsolete("use a normal date field and set its value explicitly")]
5959
public ITimestampField TimestampField { get; set; }
6060

6161
/// <inheritdoc/>
62-
[Obsolete("will be replaced with a different implementation in a future version of Elasticsearch")]
62+
[Obsolete("Will be replaced with a different implementation in a future version of Elasticsearch")]
6363
public ITtlField TtlField { get; set; }
6464
#pragma warning restore 618
6565
}
@@ -102,15 +102,15 @@ public PutMappingRequest() : this(typeof(T), typeof(T)) { }
102102
public ISourceField SourceField { get; set; }
103103
#pragma warning disable 618
104104
/// <inheritdoc/>
105-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
105+
[Obsolete("Deprecated in 2.0.0. Removed in 5.0.0")]
106106
public IList<IMappingTransform> Transform { get; set; }
107107

108108
/// <inheritdoc/>
109109
[Obsolete("use a normal date field and set its value explicitly")]
110110
public ITimestampField TimestampField { get; set; }
111111

112112
/// <inheritdoc/>
113-
[Obsolete("will be replaced with a different implementation in a future version of Elasticsearch")]
113+
[Obsolete("Will be replaced with a different implementation in a future version of Elasticsearch")]
114114
public ITtlField TtlField { get; set; }
115115
#pragma warning restore 618
116116
}
@@ -141,7 +141,7 @@ public PutMappingDescriptor(IndexName index, TypeName type) : base(r=>r.Required
141141
ISourceField ITypeMapping.SourceField { get; set; }
142142

143143
#pragma warning disable 618
144-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
144+
[Obsolete("Deprecated in 2.0.0. Removed in 5.0.0")]
145145
IList<IMappingTransform> ITypeMapping.Transform { get; set; }
146146

147147
[Obsolete("use a normal date field and set its value explicitly")]
@@ -216,11 +216,11 @@ public PutMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int maxR
216216

217217
#pragma warning disable 618
218218
/// <inheritdoc/>
219-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
219+
[Obsolete("Deprecated in 2.0.0 Removed in 5.0.0")]
220220
public PutMappingDescriptor<T> Transform(IEnumerable<IMappingTransform> transforms) => Assign(a => a.Transform = transforms.ToListOrNullIfEmpty());
221221

222222
/// <inheritdoc/>
223-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
223+
[Obsolete("Deprecated in 2.0.0 Removed in 5.0.0")]
224224
public PutMappingDescriptor<T> Transform(Func<MappingTransformsDescriptor, IPromise<IList<IMappingTransform>>> selector) =>
225225
Assign(a => a.Transform = selector?.Invoke(new MappingTransformsDescriptor())?.Value);
226226

@@ -229,7 +229,7 @@ public PutMappingDescriptor<T> Transform(Func<MappingTransformsDescriptor, IProm
229229
public PutMappingDescriptor<T> TimestampField(Func<TimestampFieldDescriptor<T>, ITimestampField> timestampFieldSelector) => Assign(a => a.TimestampField = timestampFieldSelector?.Invoke(new TimestampFieldDescriptor<T>()));
230230

231231
/// <inheritdoc/>
232-
[Obsolete("will be replaced with a different implementation in a future version of Elasticsearch")]
232+
[Obsolete("Will be replaced with a different implementation in a future version of Elasticsearch")]
233233
public PutMappingDescriptor<T> TtlField(Func<TtlFieldDescriptor, ITtlField> ttlFieldSelector) => Assign(a => a.TtlField = ttlFieldSelector?.Invoke(new TtlFieldDescriptor()));
234234
#pragma warning restore 618
235235

src/Nest/Mapping/AttributeBased/ElasticsearchPropertyAttributeBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ public abstract class ElasticsearchPropertyAttributeBase : Attribute, IProperty,
2828
public string Name { get; set; }
2929
public bool Ignore { get; set; }
3030
public bool DocValues { get { return Self.DocValues.GetValueOrDefault(); } set { Self.DocValues = value; } }
31+
[Obsolete("Removed in 2.0.0. Use CopyTo instead.")]
3132
public string IndexName { get { return Self.IndexName; } set { Self.IndexName = value; } }
3233
public SimilarityOption Similarity { get { return Self.Similarity.GetValueOrDefault(); } set { Self.Similarity = value; } }
3334

3435
#pragma warning disable CS0618 // Type or member is obsolete
35-
[Obsolete("This is a temporary binary backwards compatible hack to make sure you can specify named similarities in 2.x, scheduled for removal in 5.0")]
36+
[Obsolete("This is a temporary binary backwards compatible fix to allow named similarities in 2.0.0. Removed in 5.0.0")]
3637
public string CustomSimilarity { get { return Self.CustomSimilarity; } set { Self.CustomSimilarity = value; } }
3738
#pragma warning restore CS0618 // Type or member is obsolete
3839
public bool Store { get { return Self.Store.GetValueOrDefault(); } set { Self.Store = value; } }

src/Nest/Mapping/Transform/MappingTransform.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Nest
66
{
77
[JsonConverter(typeof(ReadAsTypeJsonConverter<MappingTransform>))]
8-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
8+
[Obsolete("Deprecated in 2.0.0 Removed in 5.0.0")]
99
public interface IMappingTransform
1010
{
1111
[JsonProperty("script")]
@@ -21,7 +21,7 @@ public interface IMappingTransform
2121
string Language { get; set; }
2222
}
2323

24-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
24+
[Obsolete("Deprecated in 2.0.0 Removed in 5.0.0")]
2525
public class MappingTransform: IMappingTransform
2626
{
2727
public string Script { get; set; }
@@ -33,7 +33,7 @@ public class MappingTransform: IMappingTransform
3333
public string Language { get; set; }
3434
}
3535

36-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
36+
[Obsolete("Deprecated in 2.0.0 Removed in 5.0.0")]
3737
public class MappingTransformDescriptor : DescriptorBase<MappingTransformDescriptor, IMappingTransform>, IMappingTransform
3838
{
3939
string IMappingTransform.Script { get; set; }
@@ -56,7 +56,7 @@ public class MappingTransformDescriptor : DescriptorBase<MappingTransformDescrip
5656

5757
}
5858

59-
[Obsolete("Deprecated in 2.0. Will be removed in the next major version release.")]
59+
[Obsolete("Deprecated in 2.0.0 Removed in 5.0.0")]
6060
public class MappingTransformsDescriptor: DescriptorPromiseBase<MappingTransformsDescriptor, IList<IMappingTransform>>
6161
{
6262
public MappingTransformsDescriptor() : base(new List<IMappingTransform>()) { }

0 commit comments

Comments
 (0)