# Parallel Queries on Elasticsearch

**URL:** <https://discuss.elastic.co/t/parallel-queries-on-elasticsearch/321541>\
**Category:** Elasticsearch\
**Created:** [December 19, 2022, 10:11am UTC](https://discuss.elastic.co/t/parallel-queries-on-elasticsearch/321541 "2022-12-19T10:11:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheharyar\_Khalid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sheharyar_khalid/32/112227_2.png) [@Sheharyar\_Khalid](https://discuss.elastic.co/u/Sheharyar_Khalid)\
**Post date:** [December 19, 2022, 10:11am UTC](https://discuss.elastic.co/t/parallel-queries-on-elasticsearch/321541/1 "2022-12-19T10:11:05Z")

</div>

Hello everyone,  
I am new to elasticsearch and still trying out a few things.  
I have an ELK deployment with a single node with multiple indexes and shards . Are the search queries run on the data sequential or are they parallel in execution?  
For example lets say I have two queries:

```auto
1- query={“bool”: {“must” : [{“match”: {“Object2Path.string”: “nginx”}},{“match”: {“message.type”: “RECORD_EVENT”}}]}}
2- query={“bool”: {“must” : [{“match”: {“TITLE.string”: “newtitle”}},{“match”: {“message.type”: “RECORD_SUBJECT”}}]}}

```

**If I run both of them at the same time, are they executed one after the other or are they executed in parallel?**

---

<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 19, 2022, 10:33am UTC](https://discuss.elastic.co/t/parallel-queries-on-elasticsearch/321541/2 "2022-12-19T10:33:17Z")

</div>

If you are sending the queries to Elasticsearch across two seperate connections at the same time they will be executed in parallel (assuming there is enough resources).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 20, 2022, 2:53am UTC](https://discuss.elastic.co/t/parallel-queries-on-elasticsearch/321541/3 "2022-12-20T02:53:36Z")

</div>

I believe [`_msearch`](https://www.elastic.co/guide/en/elasticsearch/reference/8.5/search-multi-search.html) does parallel requests as well.

---

<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 17, 2023, 2:54am UTC](https://discuss.elastic.co/t/parallel-queries-on-elasticsearch/321541/4 "2023-01-17T02:54:24Z")

</div>

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