# Does Kibana accept using nested field data types?

**URL:** <https://discuss.elastic.co/t/does-kibana-accept-using-nested-field-data-types/355008>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [March 8, 2024, 8:07am UTC](https://discuss.elastic.co/t/does-kibana-accept-using-nested-field-data-types/355008 "2024-03-08T08:07:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alberto\_Jimenez1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alberto_jimenez1/32/124188_2.png) [@Alberto\_Jimenez1](https://discuss.elastic.co/u/Alberto_Jimenez1)\
**Post date:** [March 8, 2024, 8:07am UTC](https://discuss.elastic.co/t/does-kibana-accept-using-nested-field-data-types/355008/1 "2024-03-08T08:07:34Z")

</div>

Im facing situation where i cant use all the fileds which are inside this nested data type field of type nested....  
So can you confirm me its better mapping objects with Maximum 1 element [{}] as an object (default mapping), and use only nested data type for fields which ve more than 1 elements?? [{},{},{},...]  
Im thinking querys this Index from Java services...

Thanks,  
Regards,

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [March 19, 2024, 6:32pm UTC](https://discuss.elastic.co/t/does-kibana-accept-using-nested-field-data-types/355008/2 "2024-03-19T18:32:31Z")

</div>

One other alternative option that might work for you is to flatten the data structure of your nested documents before indexing them into Elasticsearch. The method of how the data is flattened is up to you, but you can maintain a reference of flattened documents to the original nested document using the the `join` field.

See: [https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html)

Elasticsearch also provides a `flattened` data type that can be used to flatten the data. Using that, a nested object will be mapped as a single field. To visualize fields mapped as `flattened`, you can use Runtime Fields to define fields you need for specific use.

For more on the `flattened` type and Runtime Fields, see:

- [Flattened field type | Elasticsearch Guide [8.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/flattened.html)
- [Runtime fields | Elasticsearch Guide [8.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime.html)

---

<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:** [April 16, 2024, 6:32pm UTC](https://discuss.elastic.co/t/does-kibana-accept-using-nested-field-data-types/355008/3 "2024-04-16T18:32:49Z")

</div>

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