# Java high level rest client - If I am searching from multiple indices and one of my index is not present.so,I am getting "no such index" exception, instead of exception I want the documents from other indices which are present. IS IT POSSIBLE?

**URL:** <https://discuss.elastic.co/t/java-high-level-rest-client-if-i-am-searching-from-multiple-indices-and-one-of-my-index-is-not-present-so-i-am-getting-no-such-index-exception-instead-of-exception-i-want-the-documents-from-other-indices-which-are-present-is-it-possible/177106>\
**Category:** Elasticsearch\
**Created:** [April 16, 2019, 2:18pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-if-i-am-searching-from-multiple-indices-and-one-of-my-index-is-not-present-so-i-am-getting-no-such-index-exception-instead-of-exception-i-want-the-documents-from-other-indices-which-are-present-is-it-possible/177106 "2019-04-16T14:18:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)\
**Post date:** [April 16, 2019, 2:18pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-if-i-am-searching-from-multiple-indices-and-one-of-my-index-is-not-present-so-i-am-getting-no-such-index-exception-instead-of-exception-i-want-the-documents-from-other-indices-which-are-present-is-it-possible/177106/1 "2019-04-16T14:18:40Z")

</div>

Let, I am searching from 3 indices and one of the index is not present, So I am getting "type=index\_not\_found\_exception, reason=no such index" exception but I have some documents present in another two indices which matches with the search-key.

So my question is - is there any way so that instead of exception I can get the results which are matching from other 2 indices.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 16, 2019, 2:33pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-if-i-am-searching-from-multiple-indices-and-one-of-my-index-is-not-present-so-i-am-getting-no-such-index-exception-instead-of-exception-i-want-the-documents-from-other-indices-which-are-present-is-it-possible/177106/2 "2019-04-16T14:33:26Z")

</div>

Can you make the title shorter?

Are you using concrete index names or wildcards?  
May be using index aliases would be a better choice?

---

<div class="post-metadata">

**Author:** ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)\
**Post date:** [April 21, 2019, 4:39am UTC](https://discuss.elastic.co/t/java-high-level-rest-client-if-i-am-searching-from-multiple-indices-and-one-of-my-index-is-not-present-so-i-am-getting-no-such-index-exception-instead-of-exception-i-want-the-documents-from-other-indices-which-are-present-is-it-possible/177106/3 "2019-04-21T04:39:49Z")

</div>

Yes, I am using concrete index names.

And don't know how to use alias,let me check.  
Thanks

---

<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:** [May 19, 2019, 4:39am UTC](https://discuss.elastic.co/t/java-high-level-rest-client-if-i-am-searching-from-multiple-indices-and-one-of-my-index-is-not-present-so-i-am-getting-no-such-index-exception-instead-of-exception-i-want-the-documents-from-other-indices-which-are-present-is-it-possible/177106/4 "2019-05-19T04:39:56Z")

</div>

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