Skip to content

Commit

Permalink
Treat dot in field name as a nested field in field_map of text embedd…
Browse files Browse the repository at this point in the history
…ing processor

Signed-off-by: Sanjana679 <[email protected]>
  • Loading branch information
Sanjana679 committed Nov 9, 2023
1 parent 7006c97 commit 2c7f491
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Map<String, Object> buildMapWithProcessorKeyAndOriginalValue(IngestDocument inge
for (Map.Entry<String, Object> fieldMapEntry : fieldMap.entrySet()) {
String originalKey = fieldMapEntry.getKey();
Object targetKey = fieldMapEntry.getValue();

int nestedDotIndex = originalKey.indexOf('.');
if (nestedDotIndex != -1) {
Map<String, Object> temp = new LinkedHashMap<>();
Expand All @@ -163,7 +163,7 @@ Map<String, Object> buildMapWithProcessorKeyAndOriginalValue(IngestDocument inge

originalKey = originalKey.substring(0, nestedDotIndex);

Check warning on line 164 in src/main/java/org/opensearch/neuralsearch/processor/InferenceProcessor.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/neuralsearch/processor/InferenceProcessor.java#L164

Added line #L164 was not covered by tests
}

if (targetKey instanceof Map) {
Map<String, Object> treeRes = new LinkedHashMap<>();
buildMapWithProcessorKeyAndOriginalValueForMapType(originalKey, targetKey, sourceAndMetadataMap, treeRes);
Expand Down

0 comments on commit 2c7f491

Please sign in to comment.