Java API - List all indices

Up until the new REST Client, there were a couple different ways of using the Java API to list all indices:

client.admin.indices.getAliases(new GetAliasesRequest("*")).actionGet.getAliases
client.admin().cluster().prepareState().get().getState().getMetaData().getIndices()

The new Cluster API only allows us to update cluster settings, so the second option no longer works.

The new Alias API has both Index and Exists functionality, but returns a boolean as opposed to a search response.

Therefore both previously known ways to list all indices using the Java API no longer work on the Rest High Level Client. The only way I can think to list all indices in my cluster is to use the Low Level Rest Client, but I'd rather not have both versions of the client in my code.

Is there a way to list all indices using the Java High Level Rest Client?

You already have both. Just call this:

And implement what is missing for now.

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