# Bool query to match parent and nested field not working

**URL:** https://discuss.elastic.co/t/bool-query-to-match-parent-and-nested-field-not-working/63151
**Category:** Elasticsearch
**Created:** [October 17, 2016, 6:05am UTC](https://discuss.elastic.co/t/bool-query-to-match-parent-and-nested-field-not-working/63151 "2016-10-17T06:05:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sruthi](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@sruthi](https://discuss.elastic.co/u/sruthi)
#### Post date: [October 17, 2016, 6:05am UTC](https://discuss.elastic.co/t/bool-query-to-match-parent-and-nested-field-not-working/63151/1 "2016-10-17T06:05:00Z")

</div>

I have logs like this:

```
    {
    "status":"InProgress",
    "payload":{
    "sevicename":"abc",
    }
    }

```

The below query works.

```
{
	"query":{
		"nested":{
			"path":"payload",
			"filter":{
				"bool":{
					"should":
						[
						      {
							   "term":{
								"payload.serviceName": "abc"
							       }
							}
						],
						"minimum_should_match": 1
					}
				}
			}
		}
	}

```

But I need to match the status as well. When trying to add the must clause in bool, there are no results.

```
 "must": [
     {
       "match": {
           "status": {
                  "query": "InProgress"
             }
         }
     }
  ]

```

How to query the parent field? is it possible to add reverse\_nested?

---

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [October 17, 2016, 6:25am UTC](https://discuss.elastic.co/t/bool-query-to-match-parent-and-nested-field-not-working/63151/2 "2016-10-17T06:25:46Z")

</div>

@sruthi, please could you format code in your post, using the `</>` button in the editor. Code blocks retain indentation, are color highlighted and much easier to read.

---

<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, 10:11pm UTC](https://discuss.elastic.co/t/bool-query-to-match-parent-and-nested-field-not-working/63151/3 "2017-07-05T22:11:51Z")

</div>


