max_bytes_length_exceeded_exception: Document contains at least one immense term that is too long
ElasticsearchWhat does it mean?
In a document being indexed, a term (especially a keyword/non-analyzed field value) exceeded the maximum allowed byte length (32766 bytes). Lucene cannot index a term that long.
Why does it happen?
A very long text value written to a keyword field (as a whole); e.g. an entire document body, base64 data or a long URL/identifier placed in a keyword field. Because keyword fields are not analyzed, the value is indexed as a single term and exceeds the limit.
How to fix it
Use a text (analyzed) field for long text; keyword is only for short values that need exact matching. To cap the value, use ignore_above in the mapping (values longer than this are not indexed but are still stored). If not needed, set very long fields to index:false. Re-evaluate the field design (text vs keyword) based on the data type.
More from this engine
- too_many_buckets_exceptionTrying to create too many buckets
- shard_lock_obtain_failed_exceptionObtaining shard lock timed out
- parsing_exceptionFailed to parse the search request / query DSL
- illegal_argument_exception_total_fieldsLimit of total fields has been exceeded
- verification_exceptionverification_exception: Found N problem(s) — Unknown column / Unknown index (ES|QL, SQL, EQL)
- bind_transport_exceptionbind_transport_exception (Address already in use)
- translog_corrupted_exceptiontranslog_corrupted_exception