# Get all IndexMetadata in 5.X

**URL:** https://discuss.elastic.co/t/get-all-indexmetadata-in-5-x/137305
**Category:** Elasticsearch
**Created:** [June 25, 2018, 5:59pm UTC](https://discuss.elastic.co/t/get-all-indexmetadata-in-5-x/137305 "2018-06-25T17:59:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MSem](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@MSem](https://discuss.elastic.co/u/MSem)
#### Post date: [June 25, 2018, 5:59pm UTC](https://discuss.elastic.co/t/get-all-indexmetadata-in-5-x/137305/1 "2018-06-25T17:59:18Z")

</div>

I am migrating from ES 2.X to 5.X. In 2.X I am using TransportClient to get IndexMetadata for all indexes:  
getClient().admin().cluster() .prepareState().execute().actionGet().getState().getMetaData().getIndices();

It looks like I can't get AdminClient from HighLevelRestClient in 5.X. I am also not even finding a way to use LowLevelRestClient to create an http request to get indexMetadata. How would I get IndexMetadata in 5.X and 6.X?

---

<div class="post-metadata">

### Author: ![hariso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hariso/32/50668_2.png) [@hariso](https://discuss.elastic.co/u/hariso)
#### Post date: [July 19, 2018, 11:03am UTC](https://discuss.elastic.co/t/get-all-indexmetadata-in-5-x/137305/2 "2018-07-19T11:03:10Z")

</div>

@MSem So you only need a list of all indices?

Also, anything you can do through the REST API, you can do with the low-level REST client.

---

<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: [August 16, 2018, 11:03am UTC](https://discuss.elastic.co/t/get-all-indexmetadata-in-5-x/137305/3 "2018-08-16T11:03:11Z")

</div>

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