Script field aggregation

I cannot find any information about this so I'm posting this topic. Is it possible to run terms, sum or avg aggregations on field which was created using script_fields feature?

Elasticsearch supports running aggregations on scripts, but beware that it has a significant performance impact, not only because scripts make things slow, but also because some optimizations are not available anymore (eg. ordinals on strings).

https://www.elastic.co/guide/en/elasticsearch/reference/2.1/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-script

Thank you for information Adrien.