# Best way to manage unbounded XML fields

**URL:** <https://discuss.elastic.co/t/best-way-to-manage-unbounded-xml-fields/148850>\
**Category:** Elasticsearch\
**Created:** [September 17, 2018, 2:56pm UTC](https://discuss.elastic.co/t/best-way-to-manage-unbounded-xml-fields/148850 "2018-09-17T14:56:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ea1987](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ea1987/32/51356_2.png) [@ea1987](https://discuss.elastic.co/u/ea1987)\
**Post date:** [September 17, 2018, 2:56pm UTC](https://discuss.elastic.co/t/best-way-to-manage-unbounded-xml-fields/148850/1 "2018-09-17T14:56:42Z")

</div>

Hi guys,  
I'm wondering what's the best implementation of an index which stores XML data, written and processed by logstash, with unbounded elements.  
Here is a simple example schema:

> \<xs:complexType name="root"\>  
> xs:sequence  
> \<xs:element name="header\_element" type="header\_element\_type" /\>  
> \<xs:element name="body\_element" type="body\_element\_type" maxOccurs="unbounded" /\>  
> \</xs:sequence\>   
> \</xs:complexType\>  
> \<xs:complexType name="header\_element\_type"\>  
> xs:sequence  
> \<xs:element name="trx\_data" type="string" /\>  
> \<xs:element name="name" type="string" /\>  
> \</xs:sequence\>  
> \</xs:complexType\>  
> \<xs:complexType name="body\_element\_type"\>  
> xs:sequence  
> \<xs:element name="general\_data" type="string" /\>  
> \<xs:element name="school\_data" type="integer" /\>  
> \</xs:sequence\>  
> \</xs:complexType\> Blockquote

The first idea was using an index template as best practise, but then I was told that body\_element can occurs many times ☹  
What I would like to do is to avoid writting data of a single XML payload in multiple docs (n per n body + 1 per header and using an id field to relate them) because I suspect this will stress too much ES when doing data analytics.

Any idea or suggestion will be extremely appreciated.  
Thank you guys!

Andrea

---

<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:** [October 15, 2018, 2:56pm UTC](https://discuss.elastic.co/t/best-way-to-manage-unbounded-xml-fields/148850/2 "2018-10-15T14:56:47Z")

</div>

Closed on October 15, 2018, 2:56pm UTC

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