Refresh field list via script

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Latest

Describe the issue:
Trying to find a way to automate the refreshing of fields for an index via a script. Is there a way to accomplish this via the API or curl request? Thanks

Configuration:
None

Relevant Logs or Screenshots:
None

Hey @theflakes

Maybe something here might help.

You’re welcome to adapt what you can from this script I use to do just that.