# Search multiple indices

**URL:** <https://discuss.elastic.co/t/search-multiple-indices/290972>\
**Category:** Elasticsearch\
**Created:** [December 5, 2021, 7:15am UTC](https://discuss.elastic.co/t/search-multiple-indices/290972 "2021-12-05T07:15:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alireza\_Niary](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alireza_niary/32/98260_2.png) [@Alireza\_Niary](https://discuss.elastic.co/u/Alireza_Niary)\
**Post date:** [December 5, 2021, 7:15am UTC](https://discuss.elastic.co/t/search-multiple-indices/290972/1 "2021-12-05T07:15:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 5, 2021, 7:56am UTC](https://discuss.elastic.co/t/search-multiple-indices/290972/2 "2021-12-05T07:56:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Alireza\_Niary](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alireza_niary/32/98260_2.png) [@Alireza\_Niary](https://discuss.elastic.co/u/Alireza_Niary)\
**Post date:** [December 5, 2021, 8:05am UTC](https://discuss.elastic.co/t/search-multiple-indices/290972/3 "2021-12-05T08:05:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 5, 2021, 8:50am UTC](https://discuss.elastic.co/t/search-multiple-indices/290972/4 "2021-12-05T08:50:22Z")

</div>

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.

---

<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:** [January 2, 2022, 8:50am UTC](https://discuss.elastic.co/t/search-multiple-indices/290972/5 "2022-01-02T08:50:47Z")

</div>

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