You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access to special variables _source and _fields were accidentally
removed in recent refactorings. This commit adds them back, along with a
test.
closeselastic#33884
Copy file name to clipboardExpand all lines: server/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/ScriptedMetricAggregatorFactory.java
+7-9
Original file line number
Diff line number
Diff line change
@@ -84,15 +84,13 @@ public Aggregator createInternal(Aggregator parent, boolean collectsFromSingleBu
84
84
// When this is removed, aggState (as passed to ScriptedMetricAggregator) can be changed to Map<String, Object>, since
85
85
// it won't be possible to completely replace it with another type as is possible when it's an entry in params.
86
86
ObjectaggState = newHashMap<String, Object>();
87
-
if (ScriptedMetricAggContexts.deprecatedAggParamEnabled()) {
88
-
if (aggParams.containsKey("_agg") == false) {
89
-
// Add _agg if it wasn't added manually
90
-
aggParams.put("_agg", aggState);
91
-
} else {
92
-
// If it was added manually, also use it for the agg context variable to reduce the likelihood of
93
-
// weird behavior due to multiple different variables.
94
-
aggState = aggParams.get("_agg");
95
-
}
87
+
if (aggParams.containsKey("_agg") == false) {
88
+
// Add _agg if it wasn't added manually
89
+
aggParams.put("_agg", aggState);
90
+
} else {
91
+
// If it was added manually, also use it for the agg context variable to reduce the likelihood of
92
+
// weird behavior due to multiple different variables.
Copy file name to clipboardExpand all lines: server/src/test/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetricAggStateV6CompatTests.java
0 commit comments