avnere
(Avner)
July 5, 2022, 8:06am
1
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,");
Is there a way to get list of current hot indexes through ElasticsearchClient instead the low level client?
What is the approach for doing it in Elasticsearch 8?
RabBit_BR
(andre.coelho)
July 5, 2022, 12:16pm
2
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);
avnere
(Avner)
July 5, 2022, 12:42pm
3
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)));
system
(system)
Closed
August 2, 2022, 12:43pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.