Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: bug fix for empty key values pair in elastic search mapping #11004

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,10 @@ public void setSearchableValue(
.forEach(
fieldValue -> {
String[] keyValues = fieldValue.toString().split("=");
String key = keyValues[0];
String value = keyValues[1];
String key = keyValues[0], value = "";
if (keyValues.length > 1) {
value = keyValues[1];
}
dictDoc.put(key, value);
});
searchDocument.set(fieldName, dictDoc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public static TestEntityInfo getTestEntityInfo(Urn urn) {
"value1",
"key2",
"value2",
"key3",
"",
"shortValue",
"123",
"longValue",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void testTransform() throws IOException {
assertEquals(parsedJson.get("feature2").asInt(), 1);
JsonNode browsePathV2 = (JsonNode) parsedJson.get("browsePathV2");
assertEquals(browsePathV2.asText(), "␟levelOne␟levelTwo");
assertEquals(parsedJson.get("esObjectField").get("key3").asText(), "");
}

@Test
Expand Down
Loading