anchor.diff:  ["NOTE",id="aggs-script-note"]
   ===============================
   When working with scripts, the `lang` and `params` settings can also be defined. The former defines the scripting
  -language that is used (assuming the proper language is available in es either by default or as a plugin). The latter
  +language that is used (assuming the proper language is available in Elasticsearch either by default or as a plugin). The latter
   enables defining all the "dynamic" expressions in the script as parameters, and by that keep the script itself static
  -between calls (this will ensure the use of the cached compiled scripts in elasticsearch).
  +between calls (this will ensure the use of the cached compiled scripts in Elasticsearch).
   ===============================
   
   Scripts can generate a single value or multiple values per documents. When generating multiple values, once can use the
  -`script_values_sorted` settings to indicate whether these values are sorted or not. Internally, elasticsearch can
  +`script_values_sorted` settings to indicate whether these values are sorted or not. Internally, Elasticsearch can
   perform optimizations when dealing with sorted values (for example, with the `min` aggregations, knowing the values are
  -sorted, elasticsearch will skip the iterations over all the values and rely on the first value in the list to be the
  +sorted, Elasticsearch will skip the iterations over all the values and rely on the first value in the list to be the
   minimum value among all other values associated with the same document).
   
   [float]
  
positive.code: of that bucket. This is where the real power of aggregations kicks in: *aggregations can be nested!*
  
  NOTE:	Bucketing aggregations can have sub-aggregations (bucketing or metric). The sub aggregations will be computed for 
  		each of the buckets their parent aggregation generates. There is not hard limit on the level/depth of nested
  		aggregations (one can nest an aggregation under a "parent" aggregation which is itself a sub-aggregation of
  		another higher aggregations)
  
  
negative.code: include::aggregations/metrics.asciidoc[]
  
  include::aggregations/bucket.asciidoc[]
  