Share status between painless script per hit executions

Hi!

In painless, is it possible with script fields to have a shared status that can be used in each execution of the script for each hit?

I have seen that using:

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html

you can do this kind of things.

Thanks!