Can Is possible to know the name of available index on ES?


(Sam-4) #1

Hi

I want to know the all available index name and type on elastic server
using java api?

Thanks


(Kun Niu) #2

Admin client can help you to get all the indices on ES

-----Original Message-----
From: elasticsearch@googlegroups.com
[mailto:elasticsearch@googlegroups.com] On Behalf Of sam
Sent: 2011年11月7日 17:31
To: elasticsearch
Subject: can Is possible to know the name of available index on ES?

Hi

I want to know the all available index name and type on elastic server
using
java api?

Thanks


(Sam-4) #3

Thanks for reply.can you elaborate which class method will do.

On Nov 7, 2:46 pm, "Kun Niu" haoniu...@gmail.com wrote:

Admin clientcan help you to get all the indices on ES

-----Original Message-----> From:elasticsearch@googlegroups.com> [mailto:elasticsearch@googlegroups.com]On Behalf Of sam
Sent: 2011年11月7日 17:31
To: elasticsearch
Subject: can Is possible to know the name of available index on ES?

Hi

I want to know the all available index name and type on elastic server
using
java api?

Thanks


(Jan Fiedler) #4

Take a look at the index status requesthttp://www.elasticsearch.org/guide/reference/api/admin-indices-status.html.
Its response basically gives you a map with the index status keyed by the
index name. The corresponding Java API call would look like this:

IndicesStatusResponse r =
client.admin().indices().prepareStatus().execute().actionGet()


(Shay Banon) #5

Better to use the cluster state API, less overhead.
(client.admin().cluster().prepareState()...)

On Mon, Nov 7, 2011 at 1:59 PM, Jan Fiedler fiedler.jan@gmail.com wrote:

Take a look at the index status requesthttp://www.elasticsearch.org/guide/reference/api/admin-indices-status.html.
Its response basically gives you a map with the index status keyed by the
index name. The corresponding Java API call would look like this:

IndicesStatusResponse r =
client.admin().indices().prepareStatus().execute().actionGet()


(system) #6