diff --git a/src/ApiGenerator/RestSpecification/Core/termsenum.json b/src/ApiGenerator/RestSpecification/Core/termsenum.json new file mode 100644 index 00000000000..8d66107dac3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/termsenum.json @@ -0,0 +1,35 @@ +{ + "termsenum":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html", + "description": "The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios." + }, + "stability":"beta", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path": "/{index}/_terms_enum", + "methods": [ + "GET", + "POST" + ], + "parts": { + "index": { + "type": "list", + "description": "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{}, + "body":{ + "description":"field name, string which is the prefix expected in matching terms, timeout and size for max number of results" + } + } +} diff --git a/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs b/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs index 0a840cccdab..ecd59f50dc2 100644 --- a/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs +++ b/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs @@ -2047,6 +2047,13 @@ public bool? TypedKeys } } + ///Request options for Termsenum https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html + public class TermsenumRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.POST; + public override bool SupportsBody => true; + } + ///Request options for TermVectors https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html public class TermVectorsRequestParameters : RequestParameters { diff --git a/src/Elasticsearch.Net/ElasticLowLevelClient.NoNamespace.cs b/src/Elasticsearch.Net/ElasticLowLevelClient.NoNamespace.cs index e5b8d75da0b..d13773d8473 100644 --- a/src/Elasticsearch.Net/ElasticLowLevelClient.NoNamespace.cs +++ b/src/Elasticsearch.Net/ElasticLowLevelClient.NoNamespace.cs @@ -1244,6 +1244,21 @@ public TResponse SearchTemplateUsingType(string index, string type, P [MapsApi("search_template", "index, type, body")] public Task SearchTemplateUsingTypeAsync(string index, string type, PostData body, SearchTemplateRequestParameters requestParameters = null, CancellationToken ctx = default) where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync(POST, Url($"{index:index}/{type:type}/_search/template"), ctx, body, RequestParams(requestParameters)); + ///POST on /{index}/_terms_enum https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html + ///A comma-separated list of index names to search; use the special string `_all` or Indices.All to perform the operation on all indices + ///field name, string which is the prefix expected in matching terms, timeout and size for max number of results + ///Request specific configuration such as querystring parameters & request specific connection settings. + ///Note: Beta within the Elasticsearch server, this functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded. + public TResponse Termsenum(string index, PostData body, TermsenumRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => DoRequest(POST, Url($"{index:index}/_terms_enum"), body, RequestParams(requestParameters)); + ///POST on /{index}/_terms_enum https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html + ///A comma-separated list of index names to search; use the special string `_all` or Indices.All to perform the operation on all indices + ///field name, string which is the prefix expected in matching terms, timeout and size for max number of results + ///Request specific configuration such as querystring parameters & request specific connection settings. + ///Note: Beta within the Elasticsearch server, this functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded. + [MapsApi("termsenum", "index, body")] + public Task TermsenumAsync(string index, PostData body, TermsenumRequestParameters requestParameters = null, CancellationToken ctx = default) + where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync(POST, Url($"{index:index}/_terms_enum"), ctx, body, RequestParams(requestParameters)); ///POST on /{index}/_termvectors/{id} https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html ///The index in which the document resides. ///The id of the document, when not specified a doc param should be supplied. diff --git a/src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs b/src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs index db436933ee4..01ccd5f7dce 100644 --- a/src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs +++ b/src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs @@ -1063,6 +1063,20 @@ TResponse SearchTemplateUsingType(string index, string type, PostData [Obsolete("Deprecated in version 7.0.0: Specifying types in urls has been deprecated")] Task SearchTemplateUsingTypeAsync(string index, string type, PostData body, SearchTemplateRequestParameters requestParameters = null, CancellationToken ctx = default) where TResponse : class, IElasticsearchResponse, new(); + ///POST on /{index}/_terms_enum https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html + ///A comma-separated list of index names to search; use the special string `_all` or Indices.All to perform the operation on all indices + ///field name, string which is the prefix expected in matching terms, timeout and size for max number of results + ///Request specific configuration such as querystring parameters & request specific connection settings. + ///Note: Beta within the Elasticsearch server, this functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded. + TResponse Termsenum(string index, PostData body, TermsenumRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new(); + ///POST on /{index}/_terms_enum https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html + ///A comma-separated list of index names to search; use the special string `_all` or Indices.All to perform the operation on all indices + ///field name, string which is the prefix expected in matching terms, timeout and size for max number of results + ///Request specific configuration such as querystring parameters & request specific connection settings. + ///Note: Beta within the Elasticsearch server, this functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded. + Task TermsenumAsync(string index, PostData body, TermsenumRequestParameters requestParameters = null, CancellationToken ctx = default) + where TResponse : class, IElasticsearchResponse, new(); ///POST on /{index}/_termvectors/{id} https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html ///The index in which the document resides. ///The id of the document, when not specified a doc param should be supplied.