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).
Thank you for information Adrien.