Skip to content

Scripted metric aggs ignore script level params #28819

@rjernst

Description

@rjernst

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions