# Named Query not working for Nested Query

**URL:** <https://discuss.elastic.co/t/named-query-not-working-for-nested-query/127929>\
**Category:** Elasticsearch\
**Created:** [April 13, 2018, 8:17am UTC](https://discuss.elastic.co/t/named-query-not-working-for-nested-query/127929 "2018-04-13T08:17:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarunwx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tarunwx/32/46431_2.png) [@tarunwx](https://discuss.elastic.co/u/tarunwx)\
**Post date:** [April 13, 2018, 8:17am UTC](https://discuss.elastic.co/t/named-query-not-working-for-nested-query/127929/1 "2018-04-13T08:17:47Z")

</div>

I am working on a nested attribute in document. Have two match statement on different field and want to check which of the match statement is getting hit through named\_query tag. In the response I am getting result but not the **matched\_queries** object

Where am I going wrong can someone point out ??? or it is not supported ??

\*\*

> Query

\*\*

```
POST master_skills/_search
{
  "query": {
    "nested": {
      "path": "skills",
      "query": {
        "bool": {
          "should": [
            {
              "match": {
                "skills.skill.lower_keyword": {
                  "query": "microsoft word",
                  "_name": "keyword"
                }
              }
            },
            {
              "match": {
                "skills.skill.shingle_phrases": {
                  "query": "microsoft word",
                  "_name": "phrase"
                }
              }
            }
          ],
          "minimum_should_match": 1
        }
      }
    }
  }
}

```

---

<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:** [May 11, 2018, 8:23am UTC](https://discuss.elastic.co/t/named-query-not-working-for-nested-query/127929/2 "2018-05-11T08:23:58Z")

</div>

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