diff --git a/src/CodeGeneration/ApiGenerator/Overrides/GlobalOverrides.cs b/src/CodeGeneration/ApiGenerator/Overrides/GlobalOverrides.cs index 77b4538813b..aaed60f7dbd 100644 --- a/src/CodeGeneration/ApiGenerator/Overrides/GlobalOverrides.cs +++ b/src/CodeGeneration/ApiGenerator/Overrides/GlobalOverrides.cs @@ -49,6 +49,8 @@ public class GlobalOverrides : EndpointOverridesBase public override IEnumerable SkipQueryStringParams { get; } = new[] { + "parent", //can be removed once https://github.com/elastic/elasticsearch/pull/41098 is in + "copy_settings", //this still needs a PR? "source", // allows the body to be specified as a request param, we do not want to advertise this with a strongly typed method "ttl", "timestamp", diff --git a/src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs b/src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs index 5d43960e720..111aaf16a35 100644 --- a/src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs +++ b/src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs @@ -609,9 +609,6 @@ public class CreateRequestParameters : RequestParameters public string WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } - ///ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } /// /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this /// operation visible to search, if `false` (the default) then do nothing with refreshes. @@ -638,9 +635,6 @@ public class DeleteRequestParameters : RequestParameters public string WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } - ///ID of parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } /// /// If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this /// operation visible to search, if `false` (the default) then do nothing with refreshes. @@ -757,9 +751,6 @@ public class DocumentExistsRequestParameters : RequestParameters HttpMethod.HEAD; ///A comma-separated list of stored fields to return in the response public string[] StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specify the node or shard the operation should be performed on (default: random) public string Preference { get => Q("preference"); set => Q("preference", value); } ///Specify whether to perform the operation in realtime or search mode @@ -783,9 +774,6 @@ public class DocumentExistsRequestParameters : RequestParameters { public override HttpMethod DefaultHttpMethod => HttpMethod.HEAD; - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specify the node or shard the operation should be performed on (default: random) public string Preference { get => Q("preference"); set => Q("preference", value); } ///Specify whether to perform the operation in realtime or search mode @@ -821,9 +809,6 @@ public class ExplainRequestParameters : RequestParameters Q("stored_fields"); set => Q("stored_fields", value); } ///Specify whether format-based query failures (such as providing text to a numeric field) should be ignored public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specify the node or shard the operation should be performed on (default: random) public string Preference { get => Q("preference"); set => Q("preference", value); } ///Query in the Lucene query string syntax @@ -859,9 +844,6 @@ public class GetRequestParameters : RequestParameters public override HttpMethod DefaultHttpMethod => HttpMethod.GET; ///A comma-separated list of stored fields to return in the response public string[] StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specify the node or shard the operation should be performed on (default: random) public string Preference { get => Q("preference"); set => Q("preference", value); } ///Specify whether to perform the operation in realtime or search mode @@ -892,9 +874,6 @@ public class GetScriptRequestParameters : RequestParameters { public override HttpMethod DefaultHttpMethod => HttpMethod.GET; - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specify the node or shard the operation should be performed on (default: random) public string Preference { get => Q("preference"); set => Q("preference", value); } ///Specify whether to perform the operation in realtime or search mode @@ -926,9 +905,6 @@ public class IndexRequestParameters : RequestParameters public string WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } ///Explicit operation type public OpType? OpType { get => Q("op_type"); set => Q("op_type", value); } - ///ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } /// /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this /// operation visible to search, if `false` (the default) then do nothing with refreshes. @@ -1448,9 +1424,6 @@ public class IndicesShardStoresRequestParameters : RequestParameters { public override HttpMethod DefaultHttpMethod => HttpMethod.PUT; - ///whether or not to copy settings from the source index (defaults to false) - [Obsolete("Scheduled to be removed in 7.0, Elasticsearch 6.4 will throw an exception if this is turned off see elastic/elasticsearch#30404")] - public bool? CopySettings { get => Q("copy_settings"); set => Q("copy_settings", value); } ///Explicit operation timeout public TimeSpan Timeout { get => Q("timeout"); set => Q("timeout", value); } ///Specify timeout for connection to master @@ -1462,9 +1435,6 @@ public class ShrinkIndexRequestParameters : RequestParameters { public override HttpMethod DefaultHttpMethod => HttpMethod.PUT; - ///whether or not to copy settings from the source index (defaults to false) - [Obsolete("Scheduled to be removed in 7.0, Elasticsearch 6.4 will throw an exception if this is turned off see elastic/elasticsearch#30404")] - public bool? CopySettings { get => Q("copy_settings"); set => Q("copy_settings", value); } ///Explicit operation timeout public TimeSpan Timeout { get => Q("timeout"); set => Q("timeout", value); } ///Specify timeout for connection to master @@ -1682,9 +1652,6 @@ public class MultiTermVectorsRequestParameters : RequestParameters Q("preference"); set => Q("preference", value); } ///Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". public string Routing { get => Q("routing"); set => Q("routing", value); } - ///Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specifies if requests are real-time as opposed to near-real-time (default: true). public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } ///Explicit version number for concurrency control @@ -2097,9 +2064,6 @@ public class TermVectorsRequestParameters : RequestParameters Q("preference"); set => Q("preference", value); } ///Specific routing value. public string Routing { get => Q("routing"); set => Q("routing", value); } - ///Parent id of documents. - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specifies if request is real-time as opposed to near-real-time (default: true). public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } ///Explicit version number for concurrency control @@ -2121,9 +2085,6 @@ public class UpdateRequestParameters : RequestParameters Q("_source"); set => Q("_source", value); } ///The script language (default: painless) public string Lang { get => Q("lang"); set => Q("lang", value); } - ///ID of the parent document. Is is only used for routing and when for the upsert request - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } /// /// If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this /// operation visible to search, if `false` (the default) then do nothing with refreshes. diff --git a/src/Elasticsearch.Net/Extensions/Fluent.cs b/src/Elasticsearch.Net/Extensions/Fluent.cs index 074cca24562..ada7f8d2b1e 100644 --- a/src/Elasticsearch.Net/Extensions/Fluent.cs +++ b/src/Elasticsearch.Net/Extensions/Fluent.cs @@ -4,14 +4,6 @@ namespace Elasticsearch.Net { internal static class Fluent { - [Obsolete("Use the overload that accepts TValue")] - internal static TDescriptor Assign(TDescriptor self, Action assign) - where TDescriptor : class, TInterface - { - assign(self); - return self; - } - internal static TDescriptor Assign(TDescriptor self, TValue value, Action assign) where TDescriptor : class, TInterface { diff --git a/src/Nest/Aggregations/Bucket/BucketAggregation.cs b/src/Nest/Aggregations/Bucket/BucketAggregation.cs index 09064c0cdbe..26318be41e5 100644 --- a/src/Nest/Aggregations/Bucket/BucketAggregation.cs +++ b/src/Nest/Aggregations/Bucket/BucketAggregation.cs @@ -31,10 +31,6 @@ public abstract class BucketAggregationDescriptorBase assigner) => - Fluent.Assign((TBucketAggregation)this, assigner); - protected TBucketAggregation Assign(TValue value, Action assigner) => Fluent.Assign((TBucketAggregation)this, value, assigner); diff --git a/src/Nest/Aggregations/Bucket/Terms/TermsOrder.cs b/src/Nest/Aggregations/Bucket/Terms/TermsOrder.cs index 5b8825f7250..567716f6bd0 100644 --- a/src/Nest/Aggregations/Bucket/Terms/TermsOrder.cs +++ b/src/Nest/Aggregations/Bucket/Terms/TermsOrder.cs @@ -14,11 +14,5 @@ public class TermsOrder : ISortOrder public static TermsOrder KeyAscending => new TermsOrder { Key = "_key", Order = SortOrder.Ascending }; public static TermsOrder KeyDescending => new TermsOrder { Key = "_key", Order = SortOrder.Descending }; public SortOrder Order { get; set; } - - [Obsolete("Deprecated in Elasticsearch 6.0. Use KeyAscending")] - public static TermsOrder TermAscending => new TermsOrder { Key = "_key", Order = SortOrder.Ascending }; - - [Obsolete("Deprecated in Elasticsearch 6.0. Use KeyDescending")] - public static TermsOrder TermDescending => new TermsOrder { Key = "_key", Order = SortOrder.Descending }; } } diff --git a/src/Nest/Analysis/TokenFilters/Synonym/SynonymGraphTokenFilter.cs b/src/Nest/Analysis/TokenFilters/Synonym/SynonymGraphTokenFilter.cs index 8b862d09f68..5fd5f460a35 100644 --- a/src/Nest/Analysis/TokenFilters/Synonym/SynonymGraphTokenFilter.cs +++ b/src/Nest/Analysis/TokenFilters/Synonym/SynonymGraphTokenFilter.cs @@ -18,11 +18,6 @@ public interface ISynonymGraphTokenFilter : ITokenFilter [DataMember(Name ="format")] SynonymFormat? Format { get; set; } - [DataMember(Name ="ignore_case")] - [Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")] - [JsonFormatter(typeof(NullableStringBooleanFormatter))] - bool? IgnoreCase { get; set; } - /// [DataMember(Name ="lenient")] [JsonFormatter(typeof(NullableStringBooleanFormatter))] @@ -52,10 +47,6 @@ public SynonymGraphTokenFilter() : base("synonym_graph") { } /// public SynonymFormat? Format { get; set; } - /// - [Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")] - public bool? IgnoreCase { get; set; } - /// public bool? Lenient { get; set; } @@ -77,17 +68,12 @@ public class SynonymGraphTokenFilterDescriptor bool? ISynonymGraphTokenFilter.Expand { get; set; } SynonymFormat? ISynonymGraphTokenFilter.Format { get; set; } - bool? ISynonymGraphTokenFilter.IgnoreCase { get; set; } bool? ISynonymGraphTokenFilter.Lenient { get; set; } IEnumerable ISynonymGraphTokenFilter.Synonyms { get; set; } string ISynonymGraphTokenFilter.SynonymsPath { get; set; } string ISynonymGraphTokenFilter.Tokenizer { get; set; } - /// - [Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")] - public SynonymGraphTokenFilterDescriptor IgnoreCase(bool? ignoreCase = true) => Assign(ignoreCase, (a, v) => a.IgnoreCase = v); - /// public SynonymGraphTokenFilterDescriptor Expand(bool? expand = true) => Assign(expand, (a, v) => a.Expand = v); diff --git a/src/Nest/Analysis/TokenFilters/Synonym/SynonymTokenFilter.cs b/src/Nest/Analysis/TokenFilters/Synonym/SynonymTokenFilter.cs index 45ef6cde2f0..5edc07eba6a 100644 --- a/src/Nest/Analysis/TokenFilters/Synonym/SynonymTokenFilter.cs +++ b/src/Nest/Analysis/TokenFilters/Synonym/SynonymTokenFilter.cs @@ -17,14 +17,9 @@ public interface ISynonymTokenFilter : ITokenFilter [DataMember(Name ="format")] SynonymFormat? Format { get; set; } - [DataMember(Name ="ignore_case")] - [Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")] - [JsonFormatter(typeof(NullableStringBooleanFormatter))] - bool? IgnoreCase { get; set; } - /// /// If `true` ignores exceptions while parsing the synonym configuration. It is important - // to note that only those synonym rules which cannot get parsed are ignored. + /// to note that only those synonym rules which cannot get parsed are ignored. /// [DataMember(Name ="lenient")] [JsonFormatter(typeof(NullableStringBooleanFormatter))] @@ -54,10 +49,6 @@ public SynonymTokenFilter() : base("synonym") { } /// public SynonymFormat? Format { get; set; } - /// - [Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")] - public bool? IgnoreCase { get; set; } - /// public bool? Lenient { get; set; } @@ -78,17 +69,11 @@ public class SynonymTokenFilterDescriptor protected override string Type => "synonym"; bool? ISynonymTokenFilter.Expand { get; set; } SynonymFormat? ISynonymTokenFilter.Format { get; set; } - - bool? ISynonymTokenFilter.IgnoreCase { get; set; } bool? ISynonymTokenFilter.Lenient { get; set; } IEnumerable ISynonymTokenFilter.Synonyms { get; set; } string ISynonymTokenFilter.SynonymsPath { get; set; } string ISynonymTokenFilter.Tokenizer { get; set; } - /// - [Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")] - public SynonymTokenFilterDescriptor IgnoreCase(bool? ignoreCase = true) => Assign(ignoreCase, (a, v) => a.IgnoreCase = v); - /// public SynonymTokenFilterDescriptor Expand(bool? expand = true) => Assign(expand, (a, v) => a.Expand = v); diff --git a/src/Nest/CommonAbstractions/ConnectionSettings/ConnectionSettingsBase.cs b/src/Nest/CommonAbstractions/ConnectionSettings/ConnectionSettingsBase.cs index f7a955974c6..45f69851a67 100644 --- a/src/Nest/CommonAbstractions/ConnectionSettings/ConnectionSettingsBase.cs +++ b/src/Nest/CommonAbstractions/ConnectionSettings/ConnectionSettingsBase.cs @@ -244,12 +244,6 @@ private void ApplyPropertyMappings(IList - [Obsolete("Please use " + nameof(DefaultMappingFor))] - public TConnectionSettings InferMappingFor(Func, IClrTypeMapping> selector) - where TDocument : class => - DefaultMappingFor(selector); - - /// public TConnectionSettings DefaultMappingFor(Func, IClrTypeMapping> selector) where TDocument : class { diff --git a/src/Nest/CommonAbstractions/Fluent/DescriptorBase.cs b/src/Nest/CommonAbstractions/Fluent/DescriptorBase.cs index 74e67c24157..e5647f8520a 100644 --- a/src/Nest/CommonAbstractions/Fluent/DescriptorBase.cs +++ b/src/Nest/CommonAbstractions/Fluent/DescriptorBase.cs @@ -18,9 +18,6 @@ public abstract class DescriptorBase : IDescriptor [IgnoreDataMember] protected TInterface Self => _self; - [Obsolete("Use the overload that accepts TValue")] - protected TDescriptor Assign(Action assigner) => Fluent.Assign(_self, assigner); - [MethodImpl(MethodImplOptions.AggressiveInlining)] protected TDescriptor Assign(TValue value, Action assigner) => Fluent.Assign(_self, value, assigner); diff --git a/src/Nest/CommonAbstractions/Fluent/Fluent.cs b/src/Nest/CommonAbstractions/Fluent/Fluent.cs index acdbd743aa9..4c4a6382113 100644 --- a/src/Nest/CommonAbstractions/Fluent/Fluent.cs +++ b/src/Nest/CommonAbstractions/Fluent/Fluent.cs @@ -5,14 +5,6 @@ namespace Nest { internal static class Fluent { - [Obsolete("Use the overload that accepts TValue")] - internal static TDescriptor Assign(TDescriptor self, Action assign) - where TDescriptor : class, TInterface - { - assign(self); - return self; - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static TDescriptor Assign(TDescriptor self, TValue value, Action assign) where TDescriptor : class, TInterface diff --git a/src/Nest/CommonAbstractions/Request/RequestBase.cs b/src/Nest/CommonAbstractions/Request/RequestBase.cs index fbb132e06f5..fb5b883caba 100644 --- a/src/Nest/CommonAbstractions/Request/RequestBase.cs +++ b/src/Nest/CommonAbstractions/Request/RequestBase.cs @@ -91,9 +91,6 @@ public abstract partial class RequestDescriptorBase _descriptor; - [Obsolete("Use the overload that accepts TValue")] - protected TDescriptor Assign(Action assign) => Fluent.Assign(_descriptor, assign); - protected TDescriptor Assign(TValue value, Action assign) => Fluent.Assign(_descriptor, value, assign); protected TDescriptor AssignParam(Action assigner) diff --git a/src/Nest/Document/Multiple/Bulk/BulkOperation/BulkOperationBase.cs b/src/Nest/Document/Multiple/Bulk/BulkOperation/BulkOperationBase.cs index 63193d5c33b..c0ca010d8e3 100644 --- a/src/Nest/Document/Multiple/Bulk/BulkOperation/BulkOperationBase.cs +++ b/src/Nest/Document/Multiple/Bulk/BulkOperation/BulkOperationBase.cs @@ -8,9 +8,6 @@ public abstract class BulkOperationBase : IBulkOperation public Id Id { get; set; } public IndexName Index { get; set; } - [Obsolete("This property is no longer available in indices created in Elasticsearch 6.x and up")] - public Id Parent { get; set; } - public int? RetriesOnConflict { get; set; } public Routing Routing { get; set; } public long? Version { get; set; } @@ -49,9 +46,6 @@ public abstract class BulkOperationDescriptorBase IndexName IBulkOperation.Index { get; set; } string IBulkOperation.Operation => BulkOperationType; - [Obsolete("This feature is no longer supported on indices created in Elasticsearch 6.x and up")] - Id IBulkOperation.Parent { get; set; } - int? IBulkOperation.RetriesOnConflict { get; set; } Routing IBulkOperation.Routing { get; set; } long? IBulkOperation.Version { get; set; } @@ -90,8 +84,5 @@ public abstract class BulkOperationDescriptorBase public TDescriptor VersionType(VersionType? versionType) => Assign(versionType, (a, v) => a.VersionType = v); public TDescriptor Routing(Routing routing) => Assign(routing, (a, v) => a.Routing = v); - - [Obsolete("This feature is no longer supported on indices created in Elasticsearch 6.x and up")] - public TDescriptor Parent(Id parent) => Assign(parent, (a, v) => a.Parent = v); } } diff --git a/src/Nest/Document/Multiple/Bulk/BulkOperation/IBulkOperation.cs b/src/Nest/Document/Multiple/Bulk/BulkOperation/IBulkOperation.cs index dd943052f10..4b8f70997f3 100644 --- a/src/Nest/Document/Multiple/Bulk/BulkOperation/IBulkOperation.cs +++ b/src/Nest/Document/Multiple/Bulk/BulkOperation/IBulkOperation.cs @@ -17,9 +17,6 @@ public interface IBulkOperation string Operation { get; } - [DataMember(Name = "parent")] - Id Parent { get; set; } - [DataMember(Name = "retry_on_conflict")] int? RetriesOnConflict { get; set; } diff --git a/src/Nest/Document/Multiple/BulkAll/BulkAllObservable.cs b/src/Nest/Document/Multiple/BulkAll/BulkAllObservable.cs index 33b959f4571..9e7eacb8cd5 100644 --- a/src/Nest/Document/Multiple/BulkAll/BulkAllObservable.cs +++ b/src/Nest/Document/Multiple/BulkAll/BulkAllObservable.cs @@ -119,9 +119,6 @@ private async Task BulkAsync(IList buffer, long page, int b if (request.BufferToBulk != null) request.BufferToBulk(s, buffer); else s.IndexMany(buffer); if (!string.IsNullOrEmpty(request.Pipeline)) s.Pipeline(request.Pipeline); -#pragma warning disable 618 - if (request.Refresh.HasValue) s.Refresh(request.Refresh.Value); -#pragma warning restore 618 if (request.Routing != null) s.Routing(request.Routing); if (request.WaitForActiveShards.HasValue) s.WaitForActiveShards(request.WaitForActiveShards.ToString()); diff --git a/src/Nest/Document/Multiple/BulkAll/BulkAllRequest.cs b/src/Nest/Document/Multiple/BulkAll/BulkAllRequest.cs index 513d06c3990..966d52fb3a8 100644 --- a/src/Nest/Document/Multiple/BulkAll/BulkAllRequest.cs +++ b/src/Nest/Document/Multiple/BulkAll/BulkAllRequest.cs @@ -57,10 +57,6 @@ public interface IBulkAllRequest where T : class ///The pipeline id to preprocess all the incoming documents with string Pipeline { get; set; } - ///Refresh the index after performing each operation (Elasticsearch will refresh locally) - [Obsolete("This option is scheduled for deletion in 7.0, refreshing on each _bulk makes little sense for BulkAll")] - Refresh? Refresh { get; set; } - /// The indices you wish to refresh after the bulk all completes, defaults to Indices RefreshIndices { get; set; } @@ -131,9 +127,6 @@ public BulkAllRequest(IEnumerable documents) /// public string Pipeline { get; set; } - /// - public Refresh? Refresh { get; set; } - /// public Indices RefreshIndices { get; set; } @@ -178,7 +171,6 @@ public BulkAllDescriptor(IEnumerable documents) IndexName IBulkAllRequest.Index { get; set; } int? IBulkAllRequest.MaxDegreeOfParallelism { get; set; } string IBulkAllRequest.Pipeline { get; set; } - Refresh? IBulkAllRequest.Refresh { get; set; } Indices IBulkAllRequest.RefreshIndices { get; set; } bool IBulkAllRequest.RefreshOnCompleted { get; set; } Func IBulkAllRequest.RetryDocumentPredicate { get; set; } @@ -210,11 +202,6 @@ public BulkAllDescriptor BackOffRetries(int? backoffs) => /// public BulkAllDescriptor RefreshOnCompleted(bool refresh = true) => Assign(refresh, (a, v) => a.RefreshOnCompleted = v); - /// -#pragma warning disable 618 - public BulkAllDescriptor Refresh(Refresh? refresh) => Assign(refresh, (a, v) => a.Refresh = v); -#pragma warning restore 618 - /// public BulkAllDescriptor RefreshIndices(Indices indicesToRefresh) => Assign(indicesToRefresh, (a, v) => a.RefreshIndices = v); diff --git a/src/Nest/Document/Multiple/MultiGet/Response/MultiGetHit.cs b/src/Nest/Document/Multiple/MultiGet/Response/MultiGetHit.cs index 83e608184f9..576d3881088 100644 --- a/src/Nest/Document/Multiple/MultiGet/Response/MultiGetHit.cs +++ b/src/Nest/Document/Multiple/MultiGet/Response/MultiGetHit.cs @@ -15,10 +15,8 @@ public interface IMultiGetHit where TDocument : class string Index { get; } - [Obsolete("This feature is no longer supported on indices created in Elasticsearch 6.x and up, use Routing instead.")] - string Parent { get; } - string Routing { get; } + TDocument Source { get; } string Type { get; } @@ -45,9 +43,6 @@ public class MultiGetHit : IMultiGetHit [DataMember(Name = "_index")] public string Index { get; internal set; } - [DataMember(Name = "_parent")] - public string Parent { get; internal set; } - [DataMember(Name = "_routing")] public string Routing { get; internal set; } diff --git a/src/Nest/Document/Multiple/Reindex/ReindexObservable.cs b/src/Nest/Document/Multiple/Reindex/ReindexObservable.cs index 7ab817e8d16..7b1bf7dbdf3 100644 --- a/src/Nest/Document/Multiple/Reindex/ReindexObservable.cs +++ b/src/Nest/Document/Multiple/Reindex/ReindexObservable.cs @@ -113,11 +113,6 @@ private BulkAllObservable> BulkAll(IEnumerable : IResponse where TDocument : class [DataMember(Name = "_index")] string Index { get; } - [DataMember(Name = "_parent")] - [Obsolete("No longer returned on indices created in Elasticsearch 6.0")] - string Parent { get; } - [DataMember(Name = "_routing")] string Routing { get; } @@ -43,7 +39,6 @@ public class GetResponse : ResponseBase, IGetResponse wher public bool Found { get; internal set; } public string Id { get; internal set; } public string Index { get; internal set; } - public string Parent { get; internal set; } public string Routing { get; internal set; } public TDocument Source { get; internal set; } public string Type { get; internal set; } diff --git a/src/Nest/Document/Single/Update/UpdateRequest.cs b/src/Nest/Document/Single/Update/UpdateRequest.cs index 948b020c0dd..f811fbaa205 100644 --- a/src/Nest/Document/Single/Update/UpdateRequest.cs +++ b/src/Nest/Document/Single/Update/UpdateRequest.cs @@ -50,14 +50,6 @@ public partial class UpdateRequest /// public bool? DocAsUpsert { get; set; } - /// - [Obsolete("Removed in Elasticsearch 7.x, use source filtering instead")] - public Fields Fields - { - get => Self.RequestParameters.GetQueryStringValue("fields"); - set => Self.RequestParameters.SetQueryString("fields", value); - } - /// public IScript Script { get; set; } @@ -109,20 +101,9 @@ public UpdateDescriptor ScriptedUpsert(bool? script public UpdateDescriptor Script(Func scriptSelector) => Assign(scriptSelector, (a, v) => a.Script = v?.Invoke(new ScriptDescriptor())); - public UpdateDescriptor Fields(Fields fields) => - Assign(fields, (a, v) => a.RequestParameters.SetQueryString("fields", v)); - public UpdateDescriptor Source(bool? enabled = true) => Assign(enabled, (a, v) => a.Source = v); public UpdateDescriptor Source(Func, ISourceFilter> selector) => Assign(selector, (a, v) => a.Source = new Union(v?.Invoke(new SourceFilterDescriptor()))); - - [Obsolete("Removed in Elasticsearch 7.x, use source filtering instead")] - public UpdateDescriptor Fields(params Expression>[] typedPathLookups) => - Assign(typedPathLookups,(a, v) => a.RequestParameters.SetQueryString("fields", v)); - - [Obsolete("Removed in Elasticsearch 7.x, use source filtering instead")] - public UpdateDescriptor Fields(params string[] fields) => - Assign(fields,(a, v) => a.RequestParameters.SetQueryString("fields", v)); } } diff --git a/src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs b/src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs index 196c6d3d2c0..cad45755047 100644 --- a/src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs +++ b/src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs @@ -75,13 +75,6 @@ public partial class PutMappingDescriptor where T : class ISizeField ITypeMapping.SizeField { get; set; } ISourceField ITypeMapping.SourceField { get; set; } - [Obsolete("Use the overload that accepts TValue")] - protected PutMappingDescriptor Assign(Action assigner) - { - assigner(this); - return this; - } - protected PutMappingDescriptor Assign(TValue value, Action assigner) => Fluent.Assign(this, value, assigner); diff --git a/src/Nest/Indices/Monitoring/IndicesSegments/Segment.cs b/src/Nest/Indices/Monitoring/IndicesSegments/Segment.cs index 0986e3bc50e..ac4151996fa 100644 --- a/src/Nest/Indices/Monitoring/IndicesSegments/Segment.cs +++ b/src/Nest/Indices/Monitoring/IndicesSegments/Segment.cs @@ -29,10 +29,6 @@ public class Segment [DataMember(Name ="search")] public bool Search { get; internal set; } - [DataMember(Name ="size")] - [Obsolete("Unused. Will be removed in the next major release")] - public string Size { get; internal set; } - [DataMember(Name ="size_in_bytes")] public double SizeInBytes { get; internal set; } diff --git a/src/Nest/Ingest/Processors/ScriptProcessor.cs b/src/Nest/Ingest/Processors/ScriptProcessor.cs index 0e40d6c9da4..43095981668 100644 --- a/src/Nest/Ingest/Processors/ScriptProcessor.cs +++ b/src/Nest/Ingest/Processors/ScriptProcessor.cs @@ -17,10 +17,6 @@ public interface IScriptProcessor : IProcessor [DataMember(Name ="id")] string Id { get; set; } - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - [IgnoreDataMember] - string Inline { get; set; } - /// /// The scripting language. Defaults to painless /// @@ -51,14 +47,6 @@ public class ScriptProcessor : ProcessorBase, IScriptProcessor /// public string Id { get; set; } - /// An inline script to be executed - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - public string Inline - { - get => Source; - set => Source = value; - } - /// /// The scripting language. Defaults to painless /// @@ -83,13 +71,6 @@ public class ScriptProcessorDescriptor { protected override string Name => "script"; string IScriptProcessor.Id { get; set; } - - string IScriptProcessor.Inline - { - get => Self.Source; - set => Self.Source = value; - } - string IScriptProcessor.Lang { get; set; } Dictionary IScriptProcessor.Params { get; set; } string IScriptProcessor.Source { get; set; } @@ -104,12 +85,6 @@ string IScriptProcessor.Inline /// public ScriptProcessorDescriptor Id(string id) => Assign(id, (a, v) => a.Id = v); - /// - /// An inline script to be executed - /// - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - public ScriptProcessorDescriptor Inline(string inline) => Assign(inline, (a, v) => a.Inline = v); - /// /// An inline script to be executed /// diff --git a/src/Nest/Ingest/ProcessorsDescriptor.cs b/src/Nest/Ingest/ProcessorsDescriptor.cs index a80d6cc3611..7fa587c9d9b 100644 --- a/src/Nest/Ingest/ProcessorsDescriptor.cs +++ b/src/Nest/Ingest/ProcessorsDescriptor.cs @@ -124,10 +124,6 @@ public ProcessorsDescriptor Json(Func, IJsonProces public ProcessorsDescriptor UserAgent(Func, IUserAgentProcessor> selector) where T : class => Assign(selector, (a, v) => a.AddIfNotNull(v?.Invoke(new UserAgentProcessorDescriptor()))); - [Obsolete("This method takes the wrong descriptor please use Kv")] - public ProcessorsDescriptor KeyValue(Func, IUserAgentProcessor> selector) where T : class => - Assign(selector, (a, v) => a.AddIfNotNull(v?.Invoke(new UserAgentProcessorDescriptor()))); - /// public ProcessorsDescriptor Kv(Func, IKeyValueProcessor> selector) where T : class => Assign(selector, (a, v) => a.AddIfNotNull(v?.Invoke(new KeyValueProcessorDescriptor()))); diff --git a/src/Nest/Mapping/AttributeBased/ElasticsearchTypeAttribute.cs b/src/Nest/Mapping/AttributeBased/ElasticsearchTypeAttribute.cs index ade2edf580c..095ea62df03 100644 --- a/src/Nest/Mapping/AttributeBased/ElasticsearchTypeAttribute.cs +++ b/src/Nest/Mapping/AttributeBased/ElasticsearchTypeAttribute.cs @@ -13,9 +13,6 @@ public class ElasticsearchTypeAttribute : Attribute public string IdProperty { get; set; } - [Obsolete("types are gone, if you want to set the join datatype name use RelationName instead")] - public string Name { get; set; } - public string RelationName { get; set; } public static ElasticsearchTypeAttribute From(Type type) diff --git a/src/Nest/QueryDsl/Compound/FunctionScore/Functions/ScoreFunctions.cs b/src/Nest/QueryDsl/Compound/FunctionScore/Functions/ScoreFunctions.cs index bfa9d9da435..7bdbf13da63 100644 --- a/src/Nest/QueryDsl/Compound/FunctionScore/Functions/ScoreFunctions.cs +++ b/src/Nest/QueryDsl/Compound/FunctionScore/Functions/ScoreFunctions.cs @@ -58,14 +58,6 @@ public ScoreFunctionsDescriptor FieldValueFactor(Func RandomScore(Func, IRandomScoreFunction> selector = null) => Assign(selector, (a, v) => a.AddIfNotNull(v.InvokeOrDefault(new RandomScoreFunctionDescriptor()))); - [Obsolete("Elasticsearch 7.x will require a field when a seed is provided")] - public ScoreFunctionsDescriptor RandomScore(long seed) => - Assign(seed, (a, v) => a.AddIfNotNull(new RandomScoreFunction { Seed = v })); - - [Obsolete("Elasticsearch 7.x will require a field when a seed is provided")] - public ScoreFunctionsDescriptor RandomScore(string seed) => - Assign(seed, (a, v) => a.AddIfNotNull(new RandomScoreFunction { Seed = v })); - public ScoreFunctionsDescriptor Weight(Func, IWeightFunction> selector) => Assign(selector, (a, v) => a.AddIfNotNull(v?.Invoke(new WeightFunctionDescriptor()))); diff --git a/src/Nest/Search/Search/Hits/Hit.cs b/src/Nest/Search/Search/Hits/Hit.cs index 9a3fd82fd70..b3284639f3a 100644 --- a/src/Nest/Search/Search/Hits/Hit.cs +++ b/src/Nest/Search/Search/Hits/Hit.cs @@ -10,10 +10,6 @@ public interface IHitMetadata where TDocument : class { string Id { get; } string Index { get; } - - [Obsolete("No longer returned on indexes created in Elasticsearch 6.x and up, use Routing instead")] - string Parent { get; } - string Routing { get; } [JsonFormatter(typeof(SourceFormatter<>))] @@ -35,8 +31,7 @@ public static IHitMetadata Copy(this IHitMetadata : IResponse where T : class /// AggregateDictionary Aggregations { get; } - /// - [Obsolete("Aggs has been renamed to Aggregations and will be removed in NEST 7.x")] - AggregateDictionary Aggs { get; } - /// /// Gets the statistics about the clusters on which the search query was executed. /// @@ -120,14 +116,11 @@ public class SearchResponse : ResponseBase, ISearchResponse where T : clas private IReadOnlyCollection _fields; private IReadOnlyCollection> _hits; + /// [DataMember(Name ="aggregations")] public AggregateDictionary Aggregations { get; internal set; } = AggregateDictionary.Default; - /// - [IgnoreDataMember] - public AggregateDictionary Aggs => Aggregations; - /// [DataMember(Name = "_clusters")] public ClusterStatistics Clusters { get; internal set; } diff --git a/src/Nest/Search/SearchTemplate/RenderSearchTemplate/RenderSearchTemplateRequest.cs b/src/Nest/Search/SearchTemplate/RenderSearchTemplate/RenderSearchTemplateRequest.cs index 04294016aae..5f4f71b00f5 100644 --- a/src/Nest/Search/SearchTemplate/RenderSearchTemplate/RenderSearchTemplateRequest.cs +++ b/src/Nest/Search/SearchTemplate/RenderSearchTemplate/RenderSearchTemplateRequest.cs @@ -10,10 +10,6 @@ public partial interface IRenderSearchTemplateRequest [DataMember(Name = "file")] string File { get; set; } - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - [IgnoreDataMember] - string Inline { get; set; } - [DataMember(Name = "params")] [JsonFormatter(typeof(VerbatimDictionaryKeysBaseFormatter, string, object>))] Dictionary Params { get; set; } @@ -26,13 +22,6 @@ public partial class RenderSearchTemplateRequest { public string File { get; set; } - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - public string Inline - { - get => Source; - set => Source = value; - } - public Dictionary Params { get; set; } public string Source { get; set; } } @@ -41,18 +30,9 @@ public partial class RenderSearchTemplateDescriptor { string IRenderSearchTemplateRequest.File { get; set; } - string IRenderSearchTemplateRequest.Inline - { - get => Self.Source; - set => Self.Source = value; - } - Dictionary IRenderSearchTemplateRequest.Params { get; set; } string IRenderSearchTemplateRequest.Source { get; set; } - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - public RenderSearchTemplateDescriptor Inline(string inline) => Assign(inline, (a, v) => a.Inline = v); - public RenderSearchTemplateDescriptor Source(string source) => Assign(source, (a, v) => a.Source = v); public RenderSearchTemplateDescriptor File(string file) => Assign(file, (a, v) => a.File = v); diff --git a/src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs b/src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs index 527ecf6918e..fb654b06095 100644 --- a/src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs +++ b/src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs @@ -10,10 +10,6 @@ public partial interface ISearchTemplateRequest : ICovariantSearchRequest [DataMember(Name ="id")] string Id { get; set; } - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - [IgnoreDataMember] - string Inline { get; set; } - [DataMember(Name ="params")] IDictionary Params { get; set; } @@ -25,17 +21,9 @@ public partial class SearchTemplateRequest { public string Id { get; set; } - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - public string Inline - { - get => Source; - set => Source = value; - } - public IDictionary Params { get; set; } public string Source { get; set; } - public Func, Type> TypeSelector { get; set; } protected Type ClrType { get; set; } Type ICovariantSearchRequest.ClrType => ClrType; @@ -61,21 +49,12 @@ public partial class SearchTemplateDescriptor where T : class string ISearchTemplateRequest.Id { get; set; } - string ISearchTemplateRequest.Inline - { - get => Self.Source; - set => Self.Source = value; - } - IDictionary ISearchTemplateRequest.Params { get; set; } string ISearchTemplateRequest.Source { get; set; } protected sealed override void Initialize() => TypedKeys(); - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - public SearchTemplateDescriptor Inline(string template) => Assign(template, (a, v) => a.Inline = v); - public SearchTemplateDescriptor Source(string template) => Assign(template, (a, v) => a.Source = v); public SearchTemplateDescriptor Id(string id) => Assign(id, (a, v) => a.Id = v); diff --git a/src/Nest/XPack/MachineLearning/Job/Detectors/GeographicDetector.cs b/src/Nest/XPack/MachineLearning/Job/Detectors/GeographicDetector.cs index c528691dc77..1c502127ac5 100644 --- a/src/Nest/XPack/MachineLearning/Job/Detectors/GeographicDetector.cs +++ b/src/Nest/XPack/MachineLearning/Job/Detectors/GeographicDetector.cs @@ -39,9 +39,6 @@ public LatLongDetector() : base(GeographicFunction.LatLong.GetStringValue()) { } public class LatLongDetectorDescriptor : DetectorDescriptorBase, IGeographicDetector>, IGeographicDetector where T : class { - [Obsolete("Use parameterless constructor")] - public LatLongDetectorDescriptor(string function) : base(function) { } - public LatLongDetectorDescriptor() : base(GeographicFunction.LatLong.GetStringValue()) { } Field IByFieldNameDetector.ByFieldName { get; set; } diff --git a/src/Nest/XPack/Watcher/Condition/InlineScriptCondition.cs b/src/Nest/XPack/Watcher/Condition/InlineScriptCondition.cs index 678de11bd03..5ebae86667b 100644 --- a/src/Nest/XPack/Watcher/Condition/InlineScriptCondition.cs +++ b/src/Nest/XPack/Watcher/Condition/InlineScriptCondition.cs @@ -5,10 +5,6 @@ namespace Nest { public interface IInlineScriptCondition : IScriptCondition { - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - [IgnoreDataMember] - string Inline { get; set; } - [DataMember(Name ="source")] string Source { get; set; } } @@ -17,25 +13,13 @@ public class InlineScriptCondition : ScriptConditionBase, IInlineScriptCondition { public InlineScriptCondition(string script) => Source = script; - public string Inline - { - get => Source; - set => Source = value; - } - public string Source { get; set; } } public class InlineScriptConditionDescriptor : ScriptConditionDescriptorBase, IInlineScriptCondition { - public InlineScriptConditionDescriptor(string script) => Self.Source = script; - - string IInlineScriptCondition.Inline - { - get => Self.Source; - set => Self.Source = value; - } + public InlineScriptConditionDescriptor(string source) => Self.Source = source; string IInlineScriptCondition.Source { get; set; } } diff --git a/src/Nest/XPack/Watcher/Condition/ScriptConditionBase.cs b/src/Nest/XPack/Watcher/Condition/ScriptConditionBase.cs index 87220b5f39e..641af3b8363 100644 --- a/src/Nest/XPack/Watcher/Condition/ScriptConditionBase.cs +++ b/src/Nest/XPack/Watcher/Condition/ScriptConditionBase.cs @@ -29,12 +29,6 @@ public class ScriptConditionDescriptor : DescriptorBase new IndexedScriptConditionDescriptor(id); - [Obsolete("Indexed() sets a property named id, this is confusing and thats why we intent to remove this in NEST 7.x please use Id()")] - public IndexedScriptConditionDescriptor Indexed(string id) => new IndexedScriptConditionDescriptor(id); - - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - public InlineScriptConditionDescriptor Inline(string script) => new InlineScriptConditionDescriptor(script); - public InlineScriptConditionDescriptor Source(string source) => new InlineScriptConditionDescriptor(source); } @@ -59,11 +53,10 @@ internal class ScriptConditionFormatter : IJsonFormatter { private static readonly AutomataDictionary AutomataDictionary = new AutomataDictionary { - { "inline", 0 }, - { "source", 1 }, - { "id", 2 }, - { "lang", 3 }, - { "params", 4 } + { "source", 0 }, + { "id", 1 }, + { "lang", 2 }, + { "params", 3 } }; public IScriptCondition Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver) @@ -83,16 +76,15 @@ public IScriptCondition Deserialize(ref JsonReader reader, IJsonFormatterResolve switch (value) { case 0: - case 1: scriptCondition = new InlineScriptCondition(reader.ReadString()); break; - case 2: + case 1: scriptCondition = new IndexedScriptCondition(reader.ReadString()); break; - case 3: + case 2: language = reader.ReadString(); break; - case 4: + case 3: parameters = formatterResolver.GetFormatter>() .Deserialize(ref reader, formatterResolver); break; diff --git a/src/Nest/XPack/Watcher/Transform/InlineScriptTransform.cs b/src/Nest/XPack/Watcher/Transform/InlineScriptTransform.cs index c58bd551d70..c992d455c80 100644 --- a/src/Nest/XPack/Watcher/Transform/InlineScriptTransform.cs +++ b/src/Nest/XPack/Watcher/Transform/InlineScriptTransform.cs @@ -7,23 +7,13 @@ namespace Nest [InterfaceDataContract] public interface IInlineScriptTransform : IScriptTransform { - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - [IgnoreDataMember] - string Inline { get; set; } - [DataMember(Name ="source")] string Source { get; set; } } public class InlineScriptTransform : ScriptTransformBase, IInlineScriptTransform { - public InlineScriptTransform(string script) => Source = script; - - public string Inline - { - get => Source; - set => Source = value; - } + public InlineScriptTransform(string source) => Source = source; public string Source { get; set; } } @@ -33,12 +23,6 @@ public class InlineScriptTransformDescriptor { public InlineScriptTransformDescriptor(string inline) => Self.Source = inline; - string IInlineScriptTransform.Inline - { - get => Self.Source; - set => Self.Source = value; - } - string IInlineScriptTransform.Source { get; set; } } } diff --git a/src/Nest/XPack/Watcher/Transform/ScriptTransformBase.cs b/src/Nest/XPack/Watcher/Transform/ScriptTransformBase.cs index dc30df25f38..1006231ee61 100644 --- a/src/Nest/XPack/Watcher/Transform/ScriptTransformBase.cs +++ b/src/Nest/XPack/Watcher/Transform/ScriptTransformBase.cs @@ -45,12 +45,6 @@ public class ScriptTransformDescriptor : DescriptorBase new IndexedScriptTransformDescriptor(id); - [Obsolete("Indexed() sets a property named id, this is confusing and thats why we intend to remove this in NEST 7.x please use Id()")] - public IndexedScriptTransformDescriptor Indexed(string id) => new IndexedScriptTransformDescriptor(id); - - [Obsolete("Inline is being deprecated for Source and will be removed in Elasticsearch 7.0")] - public InlineScriptTransformDescriptor Inline(string script) => new InlineScriptTransformDescriptor(script); - public InlineScriptTransformDescriptor Source(string source) => new InlineScriptTransformDescriptor(source); } @@ -58,11 +52,10 @@ internal class ScriptTransformFormatter : IJsonFormatter { private static readonly AutomataDictionary AutomataDictionary = new AutomataDictionary { - { "inline", 0 }, - { "source", 1 }, - { "id", 2 }, - { "lang", 3 }, - { "params", 4 } + { "source", 0 }, + { "id", 1 }, + { "lang", 2 }, + { "params", 3 } }; public IScriptTransform Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver) @@ -82,16 +75,15 @@ public IScriptTransform Deserialize(ref JsonReader reader, IJsonFormatterResolve switch (value) { case 0: - case 1: scriptTransform = new InlineScriptTransform(reader.ReadString()); break; - case 2: + case 1: scriptTransform = new IndexedScriptTransform(reader.ReadString()); break; - case 3: + case 2: language = reader.ReadString(); break; - case 4: + case 3: parameters = formatterResolver.GetFormatter>() .Deserialize(ref reader, formatterResolver); break; diff --git a/src/Nest/_Generated/_Descriptors.generated.cs b/src/Nest/_Generated/_Descriptors.generated.cs index 8da4bde3724..e945557b90a 100644 --- a/src/Nest/_Generated/_Descriptors.generated.cs +++ b/src/Nest/_Generated/_Descriptors.generated.cs @@ -944,9 +944,6 @@ internal CreateDescriptor() : base(){} ///Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) public CreateDescriptor WaitForActiveShards(string waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); - ///ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public CreateDescriptor Parent(string parent) => Qs("parent", parent); ///If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. public CreateDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh); /// @@ -998,9 +995,6 @@ internal DeleteDescriptor() : base(){} ///Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) public DeleteDescriptor WaitForActiveShards(string waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); - ///ID of parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public DeleteDescriptor Parent(string parent) => Qs("parent", parent); ///If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. public DeleteDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh); /// @@ -1192,9 +1186,6 @@ internal DocumentExistsDescriptor() : base(){} ///A comma-separated list of stored fields to return in the response public DocumentExistsDescriptor StoredFields(params Expression>[] fields) => Qs("stored_fields", fields?.Select(e=>(Field)e)); - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public DocumentExistsDescriptor Parent(string parent) => Qs("parent", parent); ///Specify the node or shard the operation should be performed on (default: random) public DocumentExistsDescriptor Preference(string preference) => Qs("preference", preference); ///Specify whether to perform the operation in realtime or search mode @@ -1256,9 +1247,6 @@ internal SourceExistsDescriptor() : base(){} // Request parameters - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public SourceExistsDescriptor Parent(string parent) => Qs("parent", parent); ///Specify the node or shard the operation should be performed on (default: random) public SourceExistsDescriptor Preference(string preference) => Qs("preference", preference); ///Specify whether to perform the operation in realtime or search mode @@ -1330,9 +1318,6 @@ internal ExplainDescriptor() : base(){} public ExplainDescriptor Df(string df) => Qs("df", df); ///Specify whether format-based query failures (such as providing text to a numeric field) should be ignored public ExplainDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public ExplainDescriptor Parent(string parent) => Qs("parent", parent); ///Specify the node or shard the operation should be performed on (default: random) public ExplainDescriptor Preference(string preference) => Qs("preference", preference); ///Query in the Lucene query string syntax @@ -1427,9 +1412,6 @@ internal GetDescriptor() : base(){} ///A comma-separated list of stored fields to return in the response public GetDescriptor StoredFields(params Expression>[] fields) => Qs("stored_fields", fields?.Select(e=>(Field)e)); - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public GetDescriptor Parent(string parent) => Qs("parent", parent); ///Specify the node or shard the operation should be performed on (default: random) public GetDescriptor Preference(string preference) => Qs("preference", preference); ///Specify whether to perform the operation in realtime or search mode @@ -1508,9 +1490,6 @@ internal SourceDescriptor() : base(){} // Request parameters - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public SourceDescriptor Parent(string parent) => Qs("parent", parent); ///Specify the node or shard the operation should be performed on (default: random) public SourceDescriptor Preference(string preference) => Qs("preference", preference); ///Specify whether to perform the operation in realtime or search mode @@ -1581,9 +1560,6 @@ public IndexDescriptor(TDocument documentWithId, IndexName index = null, Id id = public IndexDescriptor WaitForActiveShards(string waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); ///Explicit operation type public IndexDescriptor OpType(OpType? opType) => Qs("op_type", opType); - ///ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public IndexDescriptor Parent(string parent) => Qs("parent", parent); ///If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. public IndexDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh); /// @@ -2634,9 +2610,6 @@ internal ShrinkIndexDescriptor() : base(){} // Request parameters - ///whether or not to copy settings from the source index (defaults to false) - [Obsolete("Scheduled to be removed in 7.0, Elasticsearch 6.4 will throw an exception if this is turned off see elastic/elasticsearch#30404")] - public ShrinkIndexDescriptor CopySettings(bool? copySettings = true) => Qs("copy_settings", copySettings); ///Explicit operation timeout public ShrinkIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); ///Specify timeout for connection to master @@ -2666,9 +2639,6 @@ internal SplitIndexDescriptor() : base(){} // Request parameters - ///whether or not to copy settings from the source index (defaults to false) - [Obsolete("Scheduled to be removed in 7.0, Elasticsearch 6.4 will throw an exception if this is turned off see elastic/elasticsearch#30404")] - public SplitIndexDescriptor CopySettings(bool? copySettings = true) => Qs("copy_settings", copySettings); ///Explicit operation timeout public SplitIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); ///Specify timeout for connection to master @@ -3075,9 +3045,6 @@ public MultiTermVectorsDescriptor(IndexName index) : base(r => r.Optional("index /// if that document has a or a routing mapping on for its type exists on /// public MultiTermVectorsDescriptor Routing(Routing routing) => Qs("routing", routing); - ///Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public MultiTermVectorsDescriptor Parent(string parent) => Qs("parent", parent); ///Specifies if requests are real-time as opposed to near-real-time (default: true). public MultiTermVectorsDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); ///Explicit version number for concurrency control @@ -3870,9 +3837,6 @@ public TermVectorsDescriptor(TDocument documentWithId, IndexName index = null, I /// if that document has a or a routing mapping on for its type exists on /// public TermVectorsDescriptor Routing(Routing routing) => Qs("routing", routing); - ///Parent id of documents. - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public TermVectorsDescriptor Parent(string parent) => Qs("parent", parent); ///Specifies if request is real-time as opposed to near-real-time (default: true). public TermVectorsDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); ///Explicit version number for concurrency control @@ -3916,9 +3880,6 @@ internal UpdateDescriptor() : base(){} public UpdateDescriptor SourceEnabled(bool? sourceEnabled = true) => Qs("_source", sourceEnabled); ///The script language (default: painless) public UpdateDescriptor Lang(string lang) => Qs("lang", lang); - ///ID of the parent document. Is is only used for routing and when for the upsert request - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public UpdateDescriptor Parent(string parent) => Qs("parent", parent); ///If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. public UpdateDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh); ///Specify how many times should the operation be retried when a conflict occurs (default: 0) diff --git a/src/Nest/_Generated/_Requests.generated.cs b/src/Nest/_Generated/_Requests.generated.cs index 99b842937f0..38a9af86625 100644 --- a/src/Nest/_Generated/_Requests.generated.cs +++ b/src/Nest/_Generated/_Requests.generated.cs @@ -1566,9 +1566,6 @@ internal CreateRequest() : base(){} /// shard (number of replicas + 1) /// public string WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } - ///ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } /// /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this /// operation visible to search, if `false` (the default) then do nothing with refreshes. @@ -2250,9 +2247,6 @@ internal DeleteRequest() : base(){} /// shard (number of replicas + 1) /// public string WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } - ///ID of parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } /// /// If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this /// operation visible to search, if `false` (the default) then do nothing with refreshes. @@ -2566,9 +2560,6 @@ internal DocumentExistsRequest() : base(){} // Request parameters ///A comma-separated list of stored fields to return in the response public Fields StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specify the node or shard the operation should be performed on (default: random) public string Preference { get => Q("preference"); set => Q("preference", value); } ///Specify whether to perform the operation in realtime or search mode @@ -2719,9 +2710,6 @@ internal ExplainRequest() : base(){} public string Df { get => Q("df"); set => Q("df", value); } ///Specify whether format-based query failures (such as providing text to a numeric field) should be ignored public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specify the node or shard the operation should be performed on (default: random) public string Preference { get => Q("preference"); set => Q("preference", value); } ///Query in the Lucene query string syntax @@ -3671,9 +3659,6 @@ internal GetRequest() : base(){} // Request parameters ///A comma-separated list of stored fields to return in the response public Fields StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } - ///The ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specify the node or shard the operation should be performed on (default: random) public string Preference { get => Q("preference"); set => Q("preference", value); } ///Specify whether to perform the operation in realtime or search mode @@ -4157,9 +4142,6 @@ internal IndexRequest() : base(){} public string WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } ///Explicit operation type public OpType? OpType { get => Q("op_type"); set => Q("op_type", value); } - ///ID of the parent document - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } /// /// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this /// operation visible to search, if `false` (the default) then do nothing with refreshes. @@ -4600,9 +4582,6 @@ public MultiTermVectorsRequest(IndexName index) : base(r => r.Optional("index", /// /> /// public Routing Routing { get => Q("routing"); set => Q("routing", value); } - ///Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specifies if requests are real-time as opposed to near-real-time (default: true). public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } ///Explicit version number for concurrency control @@ -6021,9 +6000,6 @@ internal ShrinkIndexRequest() : base(){} IndexName IShrinkIndexRequest.Target => Self.RouteValues.Get("target"); // Request parameters - ///whether or not to copy settings from the source index (defaults to false) - [Obsolete("Scheduled to be removed in 7.0, Elasticsearch 6.4 will throw an exception if this is turned off see elastic/elasticsearch#30404")] - public bool? CopySettings { get => Q("copy_settings"); set => Q("copy_settings", value); } ///Explicit operation timeout public Time Timeout { get => Q public Routing Routing { get => Q("routing"); set => Q("routing", value); } - ///Parent id of documents. - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } ///Specifies if request is real-time as opposed to near-real-time (default: true). public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } ///Explicit version number for concurrency control @@ -6957,9 +6921,6 @@ internal UpdateRequest() : base(){} public bool? SourceEnabled { get => Q("_source"); set => Q("_source", value); } ///The script language (default: painless) public string Lang { get => Q("lang"); set => Q("lang", value); } - ///ID of the parent document. Is is only used for routing and when for the upsert request - [Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")] - public string Parent { get => Q("parent"); set => Q("parent", value); } /// /// If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this /// operation visible to search, if `false` (the default) then do nothing with refreshes. diff --git a/src/Tests/Tests/Document/Multiple/MultiGet/MultiGetApiTests.cs b/src/Tests/Tests/Document/Multiple/MultiGet/MultiGetApiTests.cs index 1fafc8c6de6..a21179111f0 100644 --- a/src/Tests/Tests/Document/Multiple/MultiGet/MultiGetApiTests.cs +++ b/src/Tests/Tests/Document/Multiple/MultiGet/MultiGetApiTests.cs @@ -221,9 +221,6 @@ protected override void ExpectResponse(IMultiGetResponse response) hit.Id.Should().NotBeNullOrWhiteSpace(); hit.Found.Should().BeTrue(); hit.Version.Should().Be(1); -#pragma warning disable 618 - hit.Parent.Should().BeNull(); -#pragma warning restore 618 hit.Routing.Should().NotBeNullOrEmpty(); } } diff --git a/src/Tests/Tests/Document/Single/Get/GetApiTests.cs b/src/Tests/Tests/Document/Single/Get/GetApiTests.cs index f0e498c91c1..391a5227fab 100644 --- a/src/Tests/Tests/Document/Single/Get/GetApiTests.cs +++ b/src/Tests/Tests/Document/Single/Get/GetApiTests.cs @@ -163,9 +163,6 @@ protected override void ExpectResponse(IGetResponse response) response.Source.Should().NotBeNull(); response.Source.Id.Should().Be(CommitActivityId); response.Routing.Should().NotBeNullOrEmpty(); -#pragma warning disable 618 - response.Parent.Should().BeNullOrEmpty(); -#pragma warning restore 618 } }