# Does the filter context place all nested queries in the filter context as well?

**URL:** https://discuss.elastic.co/t/does-the-filter-context-place-all-nested-queries-in-the-filter-context-as-well/97133
**Category:** Elasticsearch
**Created:** [August 15, 2017, 4:36pm UTC](https://discuss.elastic.co/t/does-the-filter-context-place-all-nested-queries-in-the-filter-context-as-well/97133 "2017-08-15T16:36:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Daverino](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@Daverino](https://discuss.elastic.co/u/Daverino)
#### Post date: [August 15, 2017, 4:36pm UTC](https://discuss.elastic.co/t/does-the-filter-context-place-all-nested-queries-in-the-filter-context-as-well/97133/1 "2017-08-15T16:36:56Z")

</div>

If I'm using the filter context of either a bool or a constant\_score query, how are nested (i.e. compound) queries treated under them? It makes sense to me that everything under it would be run as filter, but I can't find anything in the documentation that confirms that. I want to make sure there is no scoring at all while running the query to make it as efficient as possible.

I want to verify that this:

```
    {
      "query": { 
        "contant_score": { 
          "filter": [ 
             "bool" : {
                "should" : [
                   { "term" : { "tag" : "wow" } },
                   { "bool" : ... nested queries ...} }
               ]
           }
       ]
    }
  }
}    

```

will be run entirely under the filter context and that I don't have to use a constant\_score wrapper for each subquery.

---

<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: [September 12, 2017, 4:37pm UTC](https://discuss.elastic.co/t/does-the-filter-context-place-all-nested-queries-in-the-filter-context-as-well/97133/2 "2017-09-12T16:37:06Z")

</div>

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