Determine count of fields in a document

I'm new to painless scripts. I'd like to create a runtime field that returns the count of fields in a document. Can anyone help with the right script to use?

Thanks for reaching out. Our documentation might be a good starting point here. Do you have a code sample you are working on that you can share?

1 Like