Scripted fields work only on values within each individual doc. So if a doc had 3 numeric fields you could use a scripted field to add them together, or average them, or find the min, max, etc. But not across all docs or a set of docs.
But you can also use some scripting within Visualizations in the Advanced JSON field;
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.