Script vs Value Script in Terms, Range Aggregations

Hi, In the documentation of Terms Aggregation, Range Aggregation, there are 2 types of scripts: Script and Value Script.
What is the difference between them ?
Which script would perform better if i only need value of 1 field in script?

A value script is one that the field is specified in the aggregation, and the value of that field is passed into the script as _value. A normal script has access to the entire doc and would access a field value like doc['myfield'].value. There should be no appreciable difference.

Thank you @rjernst

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.