# Limit amount of dynamic fields to a 1000

**URL:** <https://discuss.elastic.co/t/limit-amount-of-dynamic-fields-to-a-1000/231908>\
**Category:** Elasticsearch\
**Created:** [May 10, 2020, 8:48pm UTC](https://discuss.elastic.co/t/limit-amount-of-dynamic-fields-to-a-1000/231908 "2020-05-10T20:48:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![galbash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/galbash/32/68040_2.png) [@galbash](https://discuss.elastic.co/u/galbash)\
**Post date:** [May 10, 2020, 8:48pm UTC](https://discuss.elastic.co/t/limit-amount-of-dynamic-fields-to-a-1000/231908/1 "2020-05-10T20:48:43Z")

</div>

Hi all,  
My use case is that I am indexing documents over which I have little control, and would like to use dynamic mappings. However, I would like to limit the number of fields in each index to a 1,000 (the default value). The problem is that for documents that cross this threshold, I would like to index only fields that already exist in the index, rather than drop the entire document with an `illegal_argument_exception: Limit of total fields [1000] in index[...] has been exceeded` (similar to what `ignore_malformed` does for fields with wrong datatype).  
Is there an easy way to achieve this (a flag similar to `ignore_malformed` maybe)? My current idea is to disable dynamic mapping on an index once I hit this error once, was wondering if a better solution exists.

Thanks in advance!

---

<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:** [June 7, 2020, 8:48pm UTC](https://discuss.elastic.co/t/limit-amount-of-dynamic-fields-to-a-1000/231908/2 "2020-06-07T20:48:45Z")

</div>

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