J.Y.Wang J.Y.Wang - 1 year ago 98
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
Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download