# Curious about query differences

**URL:** <https://discuss.elastic.co/t/curious-about-query-differences/156489>\
**Category:** Elasticsearch\
**Created:** [November 13, 2018, 2:08pm UTC](https://discuss.elastic.co/t/curious-about-query-differences/156489 "2018-11-13T14:08:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurtiskurtis](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@kurtiskurtis](https://discuss.elastic.co/u/kurtiskurtis)\
**Post date:** [November 13, 2018, 2:08pm UTC](https://discuss.elastic.co/t/curious-about-query-differences/156489/1 "2018-11-13T14:08:41Z")

</div>

Just wondering why these two queries give different results. Hoping someone can explain.

The one that works  
{  
"query": {  
"bool": {  
"must\_not": {  
"nested": {  
"path": "breadcrumbs",  
"query": {  
"exists": {  
"field": "breadcrumbs"  
}  
}  
}  
}  
}  
}  
}

and

The one that doesnt  
{  
"query":{  
"nested":{  
"path":"breadcrumbs",  
"query":{  
"bool":{  
"must\_not":[  
{  
"exists":{  
"field":"breadcrumbs"  
}  
}  
]  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 26, 2018, 3:53pm UTC](https://discuss.elastic.co/t/curious-about-query-differences/156489/2 "2018-11-26T15:53:03Z")

</div>

please take some time to write a full blown reproducible example, but also write down what your expectations are? What do you expect when you query for a field, and the inside query is not to exist for this field? Which documents should match that and which should not?

Thanks for helping!

---

<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:** [December 24, 2018, 3:53pm UTC](https://discuss.elastic.co/t/curious-about-query-differences/156489/3 "2018-12-24T15:53:08Z")

</div>

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