# Elasticsearch. Nested datatype return object instead array

**URL:** <https://discuss.elastic.co/t/elasticsearch-nested-datatype-return-object-instead-array/93409>\
**Category:** Elasticsearch\
**Created:** [July 17, 2017, 2:34pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-datatype-return-object-instead-array/93409 "2017-07-17T14:34:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcokru](https://avatars.discourse-cdn.com/v4/letter/l/bbce88/32.png) [@lcokru](https://discuss.elastic.co/u/lcokru)\
**Post date:** [July 17, 2017, 2:34pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-datatype-return-object-instead-array/93409/1 "2017-07-17T14:34:20Z")

</div>

I have the following document structure:  
  
**//nested type**  
**//nested type**  
...  
  
  
...  
  
  
...

But if in document I have only one instance of EgnaElement, search operation returns EgnaElement just as object but not array. Like this:  
...  
EgnaElement{  
EgetElement[  
...  
]  
}  
...

May be Elasticsearch has some setting to prevent this unnecessary convertion

---

<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:** [August 14, 2017, 2:34pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-datatype-return-object-instead-array/93409/2 "2017-08-14T14:34:39Z")

</div>

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