# Is there a way to get a nested field in not flattened format?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-get-a-nested-field-in-not-flattened-format/325276>\
**Category:** Elasticsearch\
**Created:** [February 10, 2023, 2:54pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-a-nested-field-in-not-flattened-format/325276 "2023-02-10T14:54:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MohammedZia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammedzia/32/117119_2.png) [@MohammedZia](https://discuss.elastic.co/u/MohammedZia)\
**Post date:** [February 10, 2023, 2:54pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-a-nested-field-in-not-flattened-format/325276/1 "2023-02-10T14:54:21Z")

</div>

I've a document that contains a field called **json\_field**. This field contains _nested_ object (a dictionary as complex as it can get, as I can't fix the shape at the moment). When I search for this field using json\_field, I don't get anything. However, making it to json\_field\* gives all the whole object but in flattened object format, along with keywords (that are also not needed).  
Is there a way to get the document as it was inserted?

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [February 10, 2023, 3:00pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-a-nested-field-in-not-flattened-format/325276/2 "2023-02-10T15:00:54Z")

</div>

Hi @MohammedZia.

Are you using [nested que](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-nested-query.html)y?

---

<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:** [March 10, 2023, 3:01pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-a-nested-field-in-not-flattened-format/325276/3 "2023-03-10T15:01:51Z")

</div>

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