# If index does not exists does not show error, return empty

**URL:** <https://discuss.elastic.co/t/if-index-does-not-exists-does-not-show-error-return-empty/339343>\
**Category:** Elasticsearch\
**Created:** [July 26, 2023, 6:57pm UTC](https://discuss.elastic.co/t/if-index-does-not-exists-does-not-show-error-return-empty/339343 "2023-07-26T18:57:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Murilo\_Livorato](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/murilo_livorato/32/123848_2.png) [@Murilo\_Livorato](https://discuss.elastic.co/u/Murilo_Livorato)\
**Post date:** [July 26, 2023, 6:57pm UTC](https://discuss.elastic.co/t/if-index-does-not-exists-does-not-show-error-return-empty/339343/1 "2023-07-26T18:57:56Z")

</div>

hello , I have a search with many indexes here -

```auto
GET index-0001, index-0002, index-0003/_search
{
  "size": 30,
  "query": {
    "match_all": {}
  }
}

```

```auto
index-0001 exists
index-0002 , does not exists . 
index-0003 exists

```

it will bring me an error because index-0002 does not exists .  
the only way to search this and bring me results that I can see , it is first - verify all indexes that I am searching , after search all the results in those indexes .

does have any configuration in the search , that I can do that I search , if index does not exists , dont show errors ( get empty ) and bring me the result from those how exists results ?

---

<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:** [July 26, 2023, 7:39pm UTC](https://discuss.elastic.co/t/if-index-does-not-exists-does-not-show-error-return-empty/339343/2 "2023-07-26T19:39:56Z")

</div>

Try with:

```
GET index-0001,index-0002,index-0003/_search?ignore_unavailable=true

```

---

<div class="post-metadata">

**Author:** ![Murilo\_Livorato](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/murilo_livorato/32/123848_2.png) [@Murilo\_Livorato](https://discuss.elastic.co/u/Murilo_Livorato)\
**Post date:** [July 27, 2023, 6:54pm UTC](https://discuss.elastic.co/t/if-index-does-not-exists-does-not-show-error-return-empty/339343/3 "2023-07-27T18:54:22Z")

</div>

thanks , It worked .

---

<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 24, 2023, 6:54pm UTC](https://discuss.elastic.co/t/if-index-does-not-exists-does-not-show-error-return-empty/339343/4 "2023-08-24T18:54:29Z")

</div>

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