From 2c7f4910d664514b218a9bcf815aaa8a0541035b Mon Sep 17 00:00:00 2001 From: Sanjana679 Date: Thu, 9 Nov 2023 04:00:38 -0500 Subject: [PATCH] Treat dot in field name as a nested field in field_map of text embedding processor Signed-off-by: Sanjana679 --- .../opensearch/neuralsearch/processor/InferenceProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opensearch/neuralsearch/processor/InferenceProcessor.java b/src/main/java/org/opensearch/neuralsearch/processor/InferenceProcessor.java index 5d20eba78..a321f93bb 100644 --- a/src/main/java/org/opensearch/neuralsearch/processor/InferenceProcessor.java +++ b/src/main/java/org/opensearch/neuralsearch/processor/InferenceProcessor.java @@ -154,7 +154,7 @@ Map buildMapWithProcessorKeyAndOriginalValue(IngestDocument inge for (Map.Entry fieldMapEntry : fieldMap.entrySet()) { String originalKey = fieldMapEntry.getKey(); Object targetKey = fieldMapEntry.getValue(); - + int nestedDotIndex = originalKey.indexOf('.'); if (nestedDotIndex != -1) { Map temp = new LinkedHashMap<>(); @@ -163,7 +163,7 @@ Map buildMapWithProcessorKeyAndOriginalValue(IngestDocument inge originalKey = originalKey.substring(0, nestedDotIndex); } - + if (targetKey instanceof Map) { Map treeRes = new LinkedHashMap<>(); buildMapWithProcessorKeyAndOriginalValueForMapType(originalKey, targetKey, sourceAndMetadataMap, treeRes);