# Max\_bytes\_length\_exceeded\_exception Reason

**URL:** <https://discuss.elastic.co/t/max-bytes-length-exceeded-exception-reason/296640>\
**Category:** Elasticsearch\
**Created:** [February 8, 2022, 5:03pm UTC](https://discuss.elastic.co/t/max-bytes-length-exceeded-exception-reason/296640 "2022-02-08T17:03:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_El\_bendary](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmed_el_bendary/32/77134_2.png) [@Ahmed\_El\_bendary](https://discuss.elastic.co/u/Ahmed_El_bendary)\
**Post date:** [February 8, 2022, 5:03pm UTC](https://discuss.elastic.co/t/max-bytes-length-exceeded-exception-reason/296640/1 "2022-02-08T17:03:36Z")

</div>

error =\>

index returned 400 \_index: \_doc \_id: 20142 \_version: 0 error: Type: illegal\_argument\_exception Reason: "Document contains at least one immense term in field="form" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[97, 104, 109, 101, 100, 32, 97, 98, 100, 101, 108, 107, 104, 97, 108, 101, 107, 32, 115, 111, 104, 97, 103, 32, 103, 105, 114, 103, 97, 32]...', original message: bytes can be at most 32766 in length; got 189342" CausedBy: "Type: max\_bytes\_length\_exceeded\_exception Reason: "bytes can be at most 32766 in length; got 189342""

PUT bug\_reports  
{  
"mappings": {  
"properties": {  
"title": {  
"type": "text"  
},  
"form": {  
"type": "flattened"  
}  
}  
}  
}

try to index form with large data  
POST bug\_reports/\_doc/1  
{  
"title": "Results are not sorted correctly.",  
"labels": {  
"priority": "urgent",  
"reason": "with large string ...........",  
}  
}

if used ignore above cannot make search using prefix query.

---

<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 8, 2022, 5:04pm UTC](https://discuss.elastic.co/t/max-bytes-length-exceeded-exception-reason/296640/2 "2022-03-08T17:04:22Z")

</div>

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