# Finding documents with "too many fields"

**URL:** <https://discuss.elastic.co/t/finding-documents-with-too-many-fields/307313>\
**Category:** Elasticsearch\
**Created:** [June 15, 2022, 6:35pm UTC](https://discuss.elastic.co/t/finding-documents-with-too-many-fields/307313 "2022-06-15T18:35:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)\
**Post date:** [June 15, 2022, 6:35pm UTC](https://discuss.elastic.co/t/finding-documents-with-too-many-fields/307313/1 "2022-06-15T18:35:46Z")

</div>

What's the easiest way to find documents from an index that appears to have too many fields.  
I want to delete those documents, but there doesn't seem to be a way to easily find them.

The background to how I get here.  
The index used to allow up to 2000 fields I believe. So any index created prior to say 7 would have documents containing up to 2000 fields without throwing errors.

But now after upgrade the cluster, new documents with more than 1000 fields would throw errors.  
It's not a bad thing to throw errors when there are too many fields. But I can't seem to figure out an easy way to sort documents based on doc\_size, or field\_size.  
We disable scripting by the way.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 21, 2022, 1:53am UTC](https://discuss.elastic.co/t/finding-documents-with-too-many-fields/307313/2 "2022-06-21T01:53:58Z")

</div>

My first reaction was a script might be able to do it, but without that your only option would be to grab all the docs and then do something external to Elasticsearch.

---

<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:** [July 19, 2022, 1:54am UTC](https://discuss.elastic.co/t/finding-documents-with-too-many-fields/307313/3 "2022-07-19T01:54:06Z")

</div>

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