# Get list of indices attached to given indices

**URL:** https://discuss.elastic.co/t/get-list-of-indices-attached-to-given-indices/13448
**Category:** Elasticsearch
**Created:** [September 3, 2013, 4:07pm UTC](https://discuss.elastic.co/t/get-list-of-indices-attached-to-given-indices/13448 "2013-09-03T16:07:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ankit\_Jain](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Ankit\_Jain](https://discuss.elastic.co/u/Ankit_Jain)
#### Post date: [September 3, 2013, 4:07pm UTC](https://discuss.elastic.co/t/get-list-of-indices-attached-to-given-indices/13448/1 "2013-09-03T16:07:28Z")

</div>

Hi All,

I would require to get the list of indices attached corresponding to given  
alias. Please suggest _Java API_ for the same.

Regards,  
Ankit Jain

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [September 3, 2013, 6:28pm UTC](https://discuss.elastic.co/t/get-list-of-indices-attached-to-given-indices/13448/2 "2013-09-03T18:28:22Z")

</div>

You can get a list of all indices from the ClusterState. From there, you  
can retrieve the indices for a given alias.

ImmutableMap\<String, ImmutableMap\<String, AliasMetaData\>\> aliases =  
client.admin().cluster().state(new  
ClusterStateRequest()).actionGet().getState().getMetaData().aliases();

ImmutableMap\<String, AliasMetaData\> alias = aliases.get(aliasName);

Cheers,

Ivan

On Tue, Sep 3, 2013 at 9:07 AM, Ankit Jain [ankitjaincs06@gmail.com](mailto:ankitjaincs06@gmail.com) wrote:

> Hi All,
> 
> I would require to get the list of indices attached corresponding to given  
> alias. Please suggest _Java API_ for the same.
> 
> Regards,  
> Ankit Jain
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:18am UTC](https://discuss.elastic.co/t/get-list-of-indices-attached-to-given-indices/13448/3 "2017-07-06T02:18:22Z")

</div>


