# Elasticsearch 2.x - Multiple filter inside should

**URL:** <https://discuss.elastic.co/t/elasticsearch-2-x-multiple-filter-inside-should/42111>\
**Category:** Elasticsearch\
**Created:** [February 18, 2016, 8:32am UTC](https://discuss.elastic.co/t/elasticsearch-2-x-multiple-filter-inside-should/42111 "2016-02-18T08:32:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Corradini](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@Diego\_Corradini](https://discuss.elastic.co/u/Diego_Corradini)\
**Post date:** [February 18, 2016, 8:32am UTC](https://discuss.elastic.co/t/elasticsearch-2-x-multiple-filter-inside-should/42111/1 "2016-02-18T08:32:20Z")

</div>

After upgrading to ES 2.x I have an issue with the following query:

```
{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "should": [
            {
              "bool": {
                "must": [
                  {
                    "terms": {
                      "_type": [
                        "xxx",
                        "yyy"
                      ]
                    }
                  },
                  {
                    "exists": {
                      "field": "aaa"
                    }
                  },
                  {
                    "exists": {
                      "field": "bbb"
                    }
                  },
                  {
                    "exists": {
                      "field": "ccc"
                    }
                  }
                ]
              }
            },
            {
              "bool": {
                "must": [
                  {
                    "term": {
                      "_type": "eee"
                    }
                  },
                  {
                    "term": {
                      "f": 0
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  }
}

```

Basically, I do not know how to replace the 'must' inside the 'should' filter with the new DSL query of ES 2.x.

Thanks in advance.

---

<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:** [July 5, 2017, 11:15pm UTC](https://discuss.elastic.co/t/elasticsearch-2-x-multiple-filter-inside-should/42111/2 "2017-07-05T23:15:23Z")

</div>


