# Elasticsearch Java Api Client (7.17.16) - GetIndexResponse

**URL:** <https://discuss.elastic.co/t/elasticsearch-java-api-client-7-17-16-getindexresponse/353035>\
**Category:** Elasticsearch\
**Created:** [February 12, 2024, 5:41am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-client-7-17-16-getindexresponse/353035 "2024-02-12T05:41:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SElasticsearch](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@SElasticsearch](https://discuss.elastic.co/u/SElasticsearch)\
**Post date:** [February 12, 2024, 5:41am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-client-7-17-16-getindexresponse/353035/1 "2024-02-12T05:41:55Z")

</div>

I am trying to fetch the list of index names matching an index prefix (for example: abc-2024-02\*)

GetIndexRequest request = new GetIndexRequest.Builder().index("abc-2024-02\*").allowNoIndices(false).expandWildcards(ExpandWildcard.Open).build();  
try {  
GetIndexResponse response = client.indices().get(request);  
}  
catch(Exception ex){}

GetIndexResponse response does not have any helper to get the indices names. Instead we get the index names , settings and all other details in a JSON.

But the Elasticsearch rest high level client (this client is deprecated) had a method "response.getIndices()" to fetch the index names.

Are there any other efficient method to get the list of index names matching a prefix pattern other than parsing the response JSON ?

---

<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:** [March 11, 2024, 5:42am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-client-7-17-16-getindexresponse/353035/2 "2024-03-11T05:42:35Z")

</div>

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