Passing "_agg" variable in scripted metric aggregation

Could someone explain the reasoning behind having to specify "_agg" : {} if script parameters are specified in the scripted metric aggregation (from this page: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-aggregations-metrics-scripted-metric-aggregation.html).

It seems like the _agg variable should always start out as empty, so it would make sense to include it by default even if other parameters are specified. In the native Java API, I see in ScriptedMetricAggregatorFactory that the _agg variable is passed in if no params are specified, so I was thinking it should just be passed in either way.

Maybe there's something I'm missing here, so thanks in advance for answering!

Found a pull request out for this, hopefully it gets added soon!

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