# Elasticsearch: illegal_argument_exception: Limit of total fields [1000] has been exceeded

**Code:** `Limit of total fields exceeded` · **Category:** API · **Seen on:** Elasticsearch, OpenSearch

The index mapping has more than 1,000 fields.

## Meaning

Dynamic mapping creates a field for every new JSON key. Documents with free-form keys (IDs as keys, user data) explode the mapping.

## Common causes

- Dynamic keys used as field names
- Logging unstructured data
- Nested objects with unbounded keys

## Quick fix

1. Restructure data into key/value arrays
2. Set `dynamic: false` or `strict`
3. Raise `index.mapping.total_fields.limit` only as a stopgap

## Detailed fix by platform

### Elasticsearch

1. `PUT my-index/_settings {"index.mapping.total_fields.limit": 2000}`

## How to diagnose

1. **Keys** — Dynamic names?
2. **Mapping** — Field count?
3. **Source** — Which producer?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/api/elasticsearch-total-fields-limit)
