J.Y.Wang J.Y.Wang - 3 months ago 7x
Java Question

how to list all the indices' name of elasticsearch using java?

In my elasticsearch I want to get all the indices' name of the cluster. How can I do using java?
I search the internet but there's no much useful information.

Val Val

You can definitely do it with the following simple Java code:

List<IndexMetaData> indices = client.admin().cluster()

The list you obtain contains the details on all the indices available in your ES cluster.