Finding documents with "too many fields"

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?

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.

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