How to use rest to display all the available indices?

Hi
Is there any way to list out all the indices by using rest api and java ?

Some tutorial and example is really appreciated!

use the _cat/indices API here

Example verbose sort by index name
curl http://localhost:9200/_cat/indices?v&s=index

Hi stephen,

Yes for this curl and cat usage i know already, but i was having some confusion on hownto implement it on java code ?

Apologies I missed that .... yes does not appear there is a direct Java API mapping to the _cat APIs but I believe you can do something like this

client.admin().indices()
      .getIndex(new GetIndexRequest())
      .actionGet().getIndices();

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