How to get a list of all available indices via the Java API?
With REST it's just the following HTTP-Request:
http://XXX.XXX.XXX.XXX:9200/_aliases
But for consistency it would be nice to do this via the Java API.
The equivalent using the Java API and the elasticsearch org.elasticsearch.client.Client
class is:
client.admin().cluster()
.prepareState().execute()
.actionGet().getState()
.getMetaData().aliases();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With