In short, you need to change the index’s default total field limit. You can do that by sending a PUT request:

curl -XPUT 'http://localhost:9200/indexname/_settings' -H "Content-Type: application/json"  -d '{"index.mapping.total_fields.limit": 10000 }'

You can do this with curl. In the command above we are doing a PUT request to localhost:9200. You will need to replace this with your Elasticsearch’s address and port.

The indexname should be replaced with the specific index name which is throwing the error. If you are not sure which one, you can find it from the error itself.

Here we are changing the limit to 10,000 but be careful with this, the more fields you create the more memory will be used by Elasticsearch.