# Query Order of Execution

**URL:** https://discuss.elastic.co/t/query-order-of-execution/203273
**Category:** Elasticsearch
**Created:** [October 11, 2019, 5:36pm UTC](https://discuss.elastic.co/t/query-order-of-execution/203273 "2019-10-11T17:36:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jaharsh93](https://avatars.discourse-cdn.com/v4/letter/j/b5ac83/32.png) [@jaharsh93](https://discuss.elastic.co/u/jaharsh93)
#### Post date: [October 11, 2019, 5:36pm UTC](https://discuss.elastic.co/t/query-order-of-execution/203273/1 "2019-10-11T17:36:23Z")

</div>

What is the order of execution of all the clauses inside the Bool clause , are they executed in parallel by elastic search and then aggregated or are they executed sequentially one after another ?

POST \_search  
{  
"query": {  
"bool" : {  
"must" : {  
"term" : { "user" : "kimchy" }  
},  
"filter": {  
"term" : { "tag" : "tech" }  
},  
"must\_not" : {  
"range" : {  
"age" : { "gte" : 10, "lte" : 20 }  
}  
},  
"should" : [  
{ "term" : { "tag" : "wow" } },  
{ "term" : { "tag" : "elasticsearch" } }  
],  
"minimum\_should\_match" : 1,  
"boost" : 1.0  
}  
}  
}

---

<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: [November 8, 2019, 5:36pm UTC](https://discuss.elastic.co/t/query-order-of-execution/203273/2 "2019-11-08T17:36:30Z")

</div>

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