Get list of current hot indexes in elasticSearch

Hi,

Currently I am getting list of current hot indexes through Low Level Client:

Request request = new Request("GET", "/_cat/aliases/" + ALIAS_NAME+ "?format=json&s=is_write_index:desc,");
  1. Is there a way to get list of current hot indexes through ElasticsearchClient instead the low level client?

  2. What is the approach for doing it in Elasticsearch 8?

Hi @avnere .

Using this way is interesting for you?

High Level Rest Client

    GetAliasesRequest getAliasesRequest = new GetAliasesRequest();
    getAliasesRequest.aliases("test_alias");
    GetAliasesResponse response = getClient().indices().getAlias(getAliasesRequest, RequestOptions.DEFAULT);

Java API Client

GetAliasRequest getAliasRequest = GetAliasRequest.of(ar -> ar.name("test_alias"));
GetAliasResponse getAliasResponse = client.indices().getAlias(getAliasRequest);

What is the different between?

GetAliasRequest getAliasRequest = GetAliasRequest.of(ar -> ar.name("test_alias"));
GetAliasResponse getAliasResponse = client.indices().getAlias(getAliasRequest);

to

ElasticsearchCatClient catClient = client.cat();

AliasesResponse	aliasesResponse = catClient.aliases(AliasesRequest.of(ar -> ar.name(indexAliasName)));

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.