# Specifying IndicesOptions in Java Rest API call

**URL:** <https://discuss.elastic.co/t/specifying-indicesoptions-in-java-rest-api-call/257782>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [December 6, 2020, 3:59pm UTC](https://discuss.elastic.co/t/specifying-indicesoptions-in-java-rest-api-call/257782 "2020-12-06T15:59:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amishar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amishar/32/76363_2.png) [@amishar](https://discuss.elastic.co/u/amishar)\
**Post date:** [December 6, 2020, 3:59pm UTC](https://discuss.elastic.co/t/specifying-indicesoptions-in-java-rest-api-call/257782/1 "2020-12-06T15:59:07Z")

</div>

Is there a way to specify IndicesOptions when making a rest api call through low level rest client in Elasticsearch 6.8(I see this option in ES7 docs)? We are migrating from transport client to rest client and we were able to specify IndicesOptions.LENIENT\_EXPAND\_OPEN in request object to ignore the closed/unavailable indices. After porting these elasticsearch calls to rest API, we are seeing `{"error":{"root_cause":[{"type":"index_closed_exception","reason":"closed"...` error. The specific call that is failing is `/index1/_status`.

---

<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:** [January 3, 2021, 3:59pm UTC](https://discuss.elastic.co/t/specifying-indicesoptions-in-java-rest-api-call/257782/2 "2021-01-03T15:59:08Z")

</div>

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