// same as IndexList, but with SegmentCount added public List <CatIndicesRecordExtended> IndexListExtended() { var requestParams = new CatIndicesRequestParameters { Format = "json", Headers = new string[] { "health", "status", "index", "creation.date.string", "uuid", "pri", "rep", "docs.count", "docs.deleted", "store.size", "pri.store.size", "segments.count" } }; var response = client.LowLevel.CatIndices <StringResponse>(requestParams); return(JsonConvert.DeserializeObject <List <CatIndicesRecordExtended> >(response.Body)); }
private String getAllIndices() { try { CatIndicesRequestParameters param = new CatIndicesRequestParameters(); param.Format = "json"; var response = client.CatIndices <StringResponse>(param); return(response.Body); } catch (Exception e) { logger.error("Exception when trying to retrieve indices! -> " + e.Message); lastError = e.Message; return(""); } }
///<summary>GET on /_cat/indices/{index} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html</para></summary> ///<param name = "index">A comma-separated list of index names to limit the returned information</param> ///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param> public Task <TResponse> IndicesAsync <TResponse>(string index, CatIndicesRequestParameters requestParameters = null, CancellationToken ctx = default) where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync <TResponse>(GET, Url($"_cat/indices/{index:index}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_cat/indices/{index} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html</para></summary> ///<param name = "index">A comma-separated list of index names to limit the returned information</param> ///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param> public TResponse Indices <TResponse>(string index, CatIndicesRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new() => DoRequest <TResponse>(GET, Url($"_cat/indices/{index:index}"), null, RequestParams(requestParameters));
///<summary>GET on /_cat/indices <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html</para></summary> ///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param> public TResponse Indices <TResponse>(CatIndicesRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new() => DoRequest <TResponse>(GET, "_cat/indices", null, RequestParams(requestParameters));
public Task <TResponse> IndicesAsync <TResponse>(CatIndicesRequestParameters requestParameters = null, CancellationToken ctx = default) where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync <TResponse>(GET, "_cat/indices", ctx, null, RequestParams(requestParameters));