# Douments structure

**URL:** <https://discuss.elastic.co/t/douments-structure/265938>\
**Category:** Elasticsearch\
**Created:** [March 2, 2021, 10:31am UTC](https://discuss.elastic.co/t/douments-structure/265938 "2021-03-02T10:31:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alessio\_Creo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alessio_creo/32/43381_2.png) [@Alessio\_Creo](https://discuss.elastic.co/u/Alessio_Creo)\
**Post date:** [March 2, 2021, 10:31am UTC](https://discuss.elastic.co/t/douments-structure/265938/1 "2021-03-02T10:31:45Z")

</div>

Hi there,

we're planning to ingest large xml payloads in our ES cluster and we'll have to do full text query on it.  
This payload can be split in more documents if nedeed but we wonder if a full text query is more performant on many small docs or in few large payload before implementing the ingestion Logstash pipeline.

Thank you very much.

Best regards,  
Alessio

---

<div class="post-metadata">

**Author:** ![vincenbr](https://avatars.discourse-cdn.com/v4/letter/v/8edcca/32.png) [@vincenbr](https://discuss.elastic.co/u/vincenbr)\
**Post date:** [March 2, 2021, 9:24pm UTC](https://discuss.elastic.co/t/douments-structure/265938/2 "2021-03-02T21:24:13Z")

</div>

Hi Alessio,  
Generally speaking, in Lucene world (or with any inverted index lookup) boolean matching (full text query before scoring) performance will not depend on the number of documents in your index.  
But rather on the size of your vocabulary (the total number of terms in your entire indexed corpus, aka dictionary size |T|) . More formally: O(log(|T|)  
Then scoring and sorting will have a performance cost based on the number of results _at best_. So anyway, splitting the same amount of text data into smaller elasticsearch documents won't have any positive impact on performance.  
To sum up: For search performance, keep your docs as big as possible, provided that they fulfill your search requirements in terms of searchable units.

---

<div class="post-metadata">

**Author:** ![Alessio\_Creo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alessio_creo/32/43381_2.png) [@Alessio\_Creo](https://discuss.elastic.co/u/Alessio_Creo)\
**Post date:** [March 3, 2021, 8:43am UTC](https://discuss.elastic.co/t/douments-structure/265938/3 "2021-03-03T08:43:29Z")

</div>

Hi Vincent,

thank you very much for your reply. We supposed that there were no benefits splitting the data but we wanted to have confirm.

Thank you again.

Best regards,  
Alessio

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 3, 2021, 9:48am UTC](https://discuss.elastic.co/t/douments-structure/265938/4 "2021-03-03T09:48:22Z")

</div>

I guess the answer may depend on what you actually mean by large documents. What is the maximum size when converted to JSON?

---

<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 31, 2021, 9:48am UTC](https://discuss.elastic.co/t/douments-structure/265938/5 "2021-03-31T09:48:37Z")

</div>

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