# Subset match query

**URL:** <https://discuss.elastic.co/t/subset-match-query/261847>\
**Category:** Elasticsearch\
**Created:** [January 21, 2021, 7:57pm UTC](https://discuss.elastic.co/t/subset-match-query/261847 "2021-01-21T19:57:47Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Josue-Salas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/josue-salas/32/82709_2.png) [@Josue-Salas](https://discuss.elastic.co/u/Josue-Salas)\
**Post date:** [January 22, 2021, 5:42pm UTC](https://discuss.elastic.co/t/subset-match-query/261847/3 "2021-01-22T17:42:03Z")

</div>

Hi Mayya, thanks for the quick response.  
The solution you posted is working fine, but when I tried to add a nested layer on top, it didn't work. So I was wondering if the terms\_set works with nested objects, I looked this post but it has no answers [Terms\_set within a nested query](https://discuss.elastic.co/t/terms-set-within-a-nested-query/218852), and what is happening to me is exactly that. When I used a nested query, there are no results in the response.

It looks like this:

```auto
{
        nested: {
          path: 'requirements',
          query: {
            terms_set: {
              'requirements.name': {
                terms: ["Python Advanced", "Critical Thinking"],
                minimum_should_match_script: {
                  source: "params.num_terms"
                },
              },
            }
          }
        }
}

```

And it works when I copy/paste the one you posted

---

_[View the full topic](https://discuss.elastic.co/t/subset-match-query/261847)._
