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

hello , I have a search with many indexes here -

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

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 ?

Try with:

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

thanks , It worked .

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