Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"indices.field_usage_stats": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html",
"description": "Returns the field usage stats for each field of an index"
},
"stability": "experimental",
"visibility": "public",
"headers": {
"accept": [
"application/json"
]
},
"url": {
"paths": [
{
"path": "/{index}/_field_usage_stats",
"methods": [
"GET"
],
"parts": {
"index": {
"type": "string",
"description": "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"
}
}
}
]
},
"params": {
"fields":{
"type":"list",
"description":"A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards)"
},
"ignore_unavailable": {
"type": "boolean",
"description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
},
"allow_no_indices": {
"type": "boolean",
"description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
},
"expand_wildcards": {
"type": "enum",
"options": [
"open",
"closed",
"hidden",
"none",
"all"
],
"default": "open",
"description": "Whether to expand wildcard expression to concrete indices that are open, closed or both."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,43 @@ public bool? Local
}
}

///<summary>Request options for FieldUsageStats <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html</para></summary>
public class FieldUsageStatsRequestParameters : RequestParameters<FieldUsageStatsRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
public override bool SupportsBody => false;
///<summary>
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have
/// been specified)
///</summary>
public bool? AllowNoIndices
{
get => Q<bool? >("allow_no_indices");
set => Q("allow_no_indices", value);
}

///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
public ExpandWildcards? ExpandWildcards
{
get => Q<ExpandWildcards? >("expand_wildcards");
set => Q("expand_wildcards", value);
}

///<summary>A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards)</summary>
public string[] Fields
{
get => Q<string[]>("fields");
set => Q("fields", value);
}

///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
public bool? IgnoreUnavailable
{
get => Q<bool? >("ignore_unavailable");
set => Q("ignore_unavailable", value);
}
}

///<summary>Request options for Flush <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html</para></summary>
public class FlushRequestParameters : RequestParameters<FlushRequestParameters>
{
Expand Down
13 changes: 13 additions & 0 deletions src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,19 @@ public TResponse TypeExists<TResponse>(string index, string type, TypeExistsRequ
[MapsApi("indices.exists_type", "index, type")]
public Task<TResponse> TypeExistsAsync<TResponse>(string index, string type, TypeExistsRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(HEAD, Url($"{index:index}/_mapping/{type:type}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /{index}/_field_usage_stats <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html</para></summary>
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
///<remarks>Note: Experimental within the Elasticsearch server, this functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental 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.</remarks>
public TResponse FieldUsageStats<TResponse>(string index, FieldUsageStatsRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"{index:index}/_field_usage_stats"), null, RequestParams(requestParameters));
///<summary>GET on /{index}/_field_usage_stats <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html</para></summary>
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
///<remarks>Note: Experimental within the Elasticsearch server, this functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental 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.</remarks>
[MapsApi("indices.field_usage_stats", "index")]
public Task<TResponse> FieldUsageStatsAsync<TResponse>(string index, FieldUsageStatsRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"{index:index}/_field_usage_stats"), ctx, null, RequestParams(requestParameters));
///<summary>POST on /_flush <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse FlushForAll<TResponse>(FlushRequestParameters requestParameters = null)
Expand Down