I need to get a document but I have no idea what index it is in. I have a bunch of indices for different days; all prefixed with "mydocs-". I've tried:
GET /mydocs-*/adoc/my_second_doc
returns "index_not_found_exception"
GET /mydocs-*/adoc/_search
{
"query": {
"bool":{
"filter": [{
"term":{
"_id": ["my_second_doc"]
}
}]
}
}
}
returns all the docs in the index.
Now, if I search the specific index I can get the doc. Problem is that I don't always know the index it is in beforehand. So, I'd have to search many, many indices for it (thousands of indices).
GET /mydocs-12/adoc/my_second_doc
returns the desired doc.
Any ideas on how to do an efficient Get/Search for the doc?