# Should non-nested queries on fields in nested documents work?

**URL:** <https://discuss.elastic.co/t/should-non-nested-queries-on-fields-in-nested-documents-work/206209>\
**Category:** Elasticsearch\
**Created:** [November 1, 2019, 7:02pm UTC](https://discuss.elastic.co/t/should-non-nested-queries-on-fields-in-nested-documents-work/206209 "2019-11-01T19:02:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgarg7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sgarg7/32/135988_2.png) [@sgarg7](https://discuss.elastic.co/u/sgarg7)\
**Post date:** [November 1, 2019, 7:02pm UTC](https://discuss.elastic.co/t/should-non-nested-queries-on-fields-in-nested-documents-work/206209/1 "2019-11-01T19:02:09Z")

</div>

I have defined a nested document in my mapping. If I query a field in the nested document as if it was any other field, I get no results. If I include the nested path in my query, I get results. Is this the expected behavior? The reason is that Kibana can see these nested fields but not create visualizations on them even if they have nothing to do with the nested property.

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [November 4, 2019, 8:34pm UTC](https://discuss.elastic.co/t/should-non-nested-queries-on-fields-in-nested-documents-work/206209/2 "2019-11-04T20:34:58Z")

</div>

Yeah, what you're seeing is the expected behavior. You can think of nested objects as if they're in separate documents. You can only query those fields with a nested query.

Kibana has very limited support for nested fields

---

<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 2, 2019, 8:35pm UTC](https://discuss.elastic.co/t/should-non-nested-queries-on-fields-in-nested-documents-work/206209/3 "2019-12-02T20:35:01Z")

</div>

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