Skip to content

Commit 57fb5fc

Browse files
committed
Hoist harder
1 parent 540818f commit 57fb5fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/JsonProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ public static void recursiveMerge(Map<String, Object> target, Map<String, Object
188188

189189
@Override
190190
public IngestDocument execute(IngestDocument document) throws Exception {
191+
Object value = apply(document.getFieldValue(field, Object.class), allowDuplicateKeys, strictJsonParsing);
191192
if (addToRoot) {
192-
Object value = apply(document.getFieldValue(field, Object.class), allowDuplicateKeys, strictJsonParsing);
193193
mergeParsedJson(document.getSourceAndMetadata(), value, addToRootConflictStrategy);
194194
} else {
195-
document.setFieldValue(targetField, apply(document.getFieldValue(field, Object.class), allowDuplicateKeys, strictJsonParsing));
195+
document.setFieldValue(targetField, value);
196196
}
197197
return document;
198198
}

0 commit comments

Comments
 (0)