Hi,
According to the documentation, I should use groovy for scripted metric agg:
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html
However, as we know, groovy has been deprecated and painless should be used.
Could you please rewrite the documentation on how to use painless with this same example?
Regards,
Bjorn