illegal_argument_exception_total_fields: Limit of total fields has been exceeded
ElasticsearchWhat does it mean?
The total number of fields in an index mapping exceeded the allowed upper limit (index.mapping.total_fields.limit, default 1000). Indexing fails because new fields cannot be added.
Why does it happen?
Usually a mapping explosion: with dynamic mapping enabled, unstructured/variable-key JSON documents (e.g. objects whose keys come from user data) add every new field to the mapping. Over time the field count grows rapidly and hits the limit.
How to fix it
To fix the root cause, model variable-key data with a flattened field or as an array of key-value pairs instead of objects; restrict dynamic mapping (dynamic: false or strict). If you genuinely need more fields, raise the limit carefully: PUT idx/_settings {"index.mapping.total_fields.limit": 2000}. Monitor for mapping explosion by checking the field count with GET idx/_mapping.
More from this engine
- shard_lock_obtain_failed_exceptionObtaining shard lock timed out
- parsing_exceptionFailed to parse the search request / query DSL
- max_bytes_length_exceeded_exceptionDocument contains at least one immense term that is too long
- 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
- recovery_engine_exceptionrecovery_engine_exception