# ES Browser Version - (2.3) - Nested Query Issues

**URL:** https://discuss.elastic.co/t/es-browser-version-2-3-nested-query-issues/51357
**Category:** Elasticsearch
**Created:** [May 30, 2016, 11:57pm UTC](https://discuss.elastic.co/t/es-browser-version-2-3-nested-query-issues/51357 "2016-05-30T23:57:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![whittssg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whittssg/32/27669_2.png) [@whittssg](https://discuss.elastic.co/u/whittssg)
#### Post date: [May 30, 2016, 11:57pm UTC](https://discuss.elastic.co/t/es-browser-version-2-3-nested-query-issues/51357/1 "2016-05-30T23:57:54Z")

</div>

Hello,

Can anyone point me in the right direction please?

I am using the following query:

```
"query": {
         bool: {
                must: [
                       {
                         "nested": {
                                    "path": "mlcs",
                                    "query": {
                                     "bool": {
                                              "must": [
                                                       {
                                                        "match": {
                                                                    "mlcs.deviceType": "\"Cheese Meat\""
                                                                 }
                                                       }
                                                      ]
                                             }
                                             }
                                    }
                        }

                       ]

               }

         }

```

My deviceType field is Analyzed but when i run the following query i get documents that contain both cheese and or meat in the deviceType nested field. I was expecting to just get deviceTypes that match the literal Cheese Meat together.

I have the same query on another index that is not nested and it only brings back docs that match Cheese Meat rather than either OR..

Thanks

---

<div class="post-metadata">

### Author: ![whittssg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whittssg/32/27669_2.png) [@whittssg](https://discuss.elastic.co/u/whittssg)
#### Post date: [June 1, 2016, 3:59pm UTC](https://discuss.elastic.co/t/es-browser-version-2-3-nested-query-issues/51357/2 "2016-06-01T15:59:40Z")

</div>

I fixed this issue by changing my nested query to this:

```
"nested": {
                                                    "path": "mlcs",
                                                    "query": {
                                                        "match": {
                                                            "mlcs.deviceType": {
                                                                "query": "\"Cheese Meat\"",
                                                                "operator": "and"
                                                            }
                                                        }

                                                    }
                                                }
```

---

<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:47pm UTC](https://discuss.elastic.co/t/es-browser-version-2-3-nested-query-issues/51357/3 "2017-07-05T22:47:13Z")

</div>


