In an Elasticsearch cluster I have about 30 indices with the same structure.
I need to find out which of the indices would return at least 1 result for my query.
The result itself does not matter. I will make the business logic decisions based on the name of the index, that contains at least 1 document that satisfies the search criteria.
The search might return from 0 up to ~10 000 000 hits over all indices depending on the input. The search will be performed ~50 000 times with the different input.
I see the following solutions:
- Use the search API with scrolling and look at all results to find out from which index they are. This is what is currently implemented and I'm looking for a faster solution.
- Use the count API and do a count for every index. This will lead to more requests. Might this be faster?
- Is there another possibility/API available?
_search?size=0instead ofsearch_type=count