diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchTemplateOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchTemplateOverrides.cs new file mode 100644 index 00000000000..e97c4a15f84 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchTemplateOverrides.cs @@ -0,0 +1,17 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + // ReSharper disable once UnusedMember.Global + public class SearchTemplateOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "explain" + }; + } +} diff --git a/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs b/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs index 941a07e39c1..27b97480474 100644 --- a/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs +++ b/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs @@ -2009,13 +2009,6 @@ public ExpandWildcards? ExpandWildcards set => Q("expand_wildcards", value); } - ///Specify whether to return detailed information about score computation as part of a hit - public bool? Explain - { - get => Q("explain"); - set => Q("explain", value); - } - ///Whether specified concrete, expanded or aliased indices should be ignored when throttled public bool? IgnoreThrottled { diff --git a/src/Nest/Descriptors.NoNamespace.cs b/src/Nest/Descriptors.NoNamespace.cs index 26daa90575c..93d33c9113e 100644 --- a/src/Nest/Descriptors.NoNamespace.cs +++ b/src/Nest/Descriptors.NoNamespace.cs @@ -1435,8 +1435,6 @@ public SearchTemplateDescriptor Index() public SearchTemplateDescriptor CcsMinimizeRoundtrips(bool? ccsminimizeroundtrips = true) => Qs("ccs_minimize_roundtrips", ccsminimizeroundtrips); ///Whether to expand wildcard expression to concrete indices that are open, closed or both. public SearchTemplateDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Specify whether to return detailed information about score computation as part of a hit - public SearchTemplateDescriptor Explain(bool? explain = true) => Qs("explain", explain); ///Whether specified concrete, expanded or aliased indices should be ignored when throttled public SearchTemplateDescriptor IgnoreThrottled(bool? ignorethrottled = true) => Qs("ignore_throttled", ignorethrottled); ///Whether specified concrete indices should be ignored when unavailable (missing or closed) diff --git a/src/Nest/Requests.NoNamespace.cs b/src/Nest/Requests.NoNamespace.cs index c65a6410c7e..b87837097c6 100644 --- a/src/Nest/Requests.NoNamespace.cs +++ b/src/Nest/Requests.NoNamespace.cs @@ -3104,13 +3104,6 @@ public ExpandWildcards? ExpandWildcards set => Q("expand_wildcards", value); } - ///Specify whether to return detailed information about score computation as part of a hit - public bool? Explain - { - get => Q("explain"); - set => Q("explain", value); - } - ///Whether specified concrete, expanded or aliased indices should be ignored when throttled public bool? IgnoreThrottled { diff --git a/src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs b/src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs index 24ce0bfcb7d..38cea6b7484 100644 --- a/src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs +++ b/src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs @@ -21,6 +21,9 @@ public partial interface ISearchTemplateRequest : ITypedSearchRequest [DataMember(Name ="source")] string Source { get; set; } + + [DataMember(Name = "explain")] + public bool? Explain { get; set; } } public partial class SearchTemplateRequest @@ -30,6 +33,9 @@ public partial class SearchTemplateRequest public IDictionary Params { get; set; } public string Source { get; set; } + + public bool? Explain { get; set; } + protected Type ClrType { get; set; } Type ITypedSearchRequest.ClrType => ClrType; @@ -54,6 +60,8 @@ public partial class SearchTemplateDescriptor where TDocument : class string ISearchTemplateRequest.Source { get; set; } + bool? ISearchTemplateRequest.Explain { get; set; } + protected sealed override void RequestDefaults(SearchTemplateRequestParameters parameters) => TypedKeys(); public SearchTemplateDescriptor Source(string template) => Assign(template, (a, v) => a.Source = v); @@ -64,5 +72,7 @@ public partial class SearchTemplateDescriptor where TDocument : class public SearchTemplateDescriptor Params(Func, FluentDictionary> paramDictionary) => Assign(paramDictionary, (a, v) => a.Params = v?.Invoke(new FluentDictionary())); + + public SearchTemplateDescriptor Explain(bool? explain = true) => Assign(explain, (a, v) => a.Explain = v); } }