Search multiple indices

Is search on multiple indices asynchronous from each other?

if I use "GET /my-index-1,my-index-2/_search"
dose Elasticsearch, search both indices simultaneous or in turn?

I'm assuming that there is one node and single shard and no replica

Each shard of indices being queried results in one task. These tasks are queued and run in parallel on the search threads available. If you query few shards it is likely that they are run completely in parallel while if you query a large number of shards it may therefore be only partially parallel if the number of tasks éxceeds the number of available threads.

thanks for answer,
how about if I assume there is one node and single shard and no replica?
It seems there is only one thread available, right?

Then each index has one shard and there are 2 shards in total being queried. The number of search threads depend on the number of CPU cores on the host but it is likely they will execute in parallel, at least if there is no other load at the time increasing the size of the queue.

1 Like

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