-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
Description
When scripts are specified, either in json or via new Script(), they take a params Map. Scripted metrics use multiple scripts, and take a params map at the outer level which applies to all of the 4 scripts of a scripted metric agg. However, the params passed directly to a script are lost.
I traced this to a flaw in ScriptedMetricAggregationBuilder. The original Script object for each script, eg mapScript, needs to be passed through (or at least the params from it) to the ScriptedMetricAggregatorFactory, and then before running each script, the relevant per script params need to be merged in (by creating a new map and added the per script params).