# Maximum document size

**URL:** <https://discuss.elastic.co/t/maximum-document-size/13086>\
**Category:** Elasticsearch\
**Created:** [August 6, 2013, 8:03am UTC](https://discuss.elastic.co/t/maximum-document-size/13086 "2013-08-06T08:03:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonios\_Giannopoulo](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@Antonios\_Giannopoulo](https://discuss.elastic.co/u/Antonios_Giannopoulo)\
**Post date:** [August 6, 2013, 8:03am UTC](https://discuss.elastic.co/t/maximum-document-size/13086/1 "2013-08-06T08:03:45Z")

</div>

I am new to ES, and i made a search the past days to determine if there is  
a limitation on the size of a single document (i know from mongo that a  
single document can't exceed 16 MB). I didn't found any relevant topic  
about single document size limitation, so my question is if any limitation  
on this exist or not?  
Thank you in advance.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [August 7, 2013, 9:27am UTC](https://discuss.elastic.co/t/maximum-document-size/13086/2 "2013-08-07T09:27:35Z")

</div>

Hi Antonio,

There is a 2GB limit at the Lucene level, but you might run into issues  
before that depending on your memory constraints. It is however quite  
unusual to have such large documents because it doesn't help much finding  
what actually matched your query. For instance if you are indexing books,  
splitting them into pages will help not only finding the matching books but  
also the matching page numbers for instance.

On Tue, Aug 6, 2013 at 10:03 AM, Antonios Giannopoulos  
[antgiann@gmail.com](mailto:antgiann@gmail.com)wrote:

> I am new to ES, and i made a search the past days to determine if there is  
> a limitation on the size of a single document (i know from mongo that a  
> single document can't exceed 16 MB). I didn't found any relevant topic  
> about single document size limitation, so my question is if any limitation  
> on this exist or not?  
> Thank you in advance.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [August 7, 2013, 5:51pm UTC](https://discuss.elastic.co/t/maximum-document-size/13086/3 "2013-08-07T17:51:29Z")

</div>

Antonios Giannopoulos wrote:

> I am new to ES, and i made a search the past days to determine  
> if there is a limitation on the size of a single document (i  
> know from mongo that a single document can't exceed 16 MB). I  
> didn't found any relevant topic about single document size  
> limitation, so my question is if any limitation on this exist or  
> not? Thank you in advance.

In addition to the info Adrien provided, from practical experience  
ES handles documents of hundreds of MB just fine.

Drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 7, 2013, 10:22pm UTC](https://discuss.elastic.co/t/maximum-document-size/13086/4 "2013-08-07T22:22:58Z")

</div>

AFAIK the 2G limit in Lucene has been dropped since Lucene 4?

[https://issues.apache.org/jira/browse/LUCENE-2295](https://issues.apache.org/jira/browse/LUCENE-2295)

So document size should only be limited by upload API buffer (HTTP REST  
default setting is 100m) and the available heap space.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [August 8, 2013, 6:25am UTC](https://discuss.elastic.co/t/maximum-document-size/13086/5 "2013-08-08T06:25:53Z")

</div>

The issues provided below is unrelated to the limit of the index writer.  
Lucene uses a byte buffer internally that uses 32bit integers for  
addressing. By definition this limits the size of the documents. We also  
force a flush if a DocumentsWriter grows \> 1950MB (that is a safety limit)  
so 2GB is max in theory but I never tested it so the limit might be hit  
earlier.

simon

On Thursday, August 8, 2013 12:22:58 AM UTC+2, Jörg Prante wrote:

> AFAIK the 2G limit in Lucene has been dropped since Lucene 4?
> 
> [[LUCENE-2295] Create a MaxFieldLengthAnalyzer to wrap any other Analyzer and provide the same functionality as MaxFieldLength provided on IndexWriter - ASF JIRA](https://issues.apache.org/jira/browse/LUCENE-2295)
> 
> So document size should only be limited by upload API buffer (HTTP REST  
> default setting is 100m) and the available heap space.
> 
> Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:22am UTC](https://discuss.elastic.co/t/maximum-document-size/13086/6 "2017-07-06T02:22:13Z")

</div>


