Skip to content
Open
Changes from all commits
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 @@ -216,12 +216,24 @@ private void upsertDocument(String uniqueId, Map<String, Object> message, Map<St
case CompositeSearchConstants.OPERATION_CREATE: {
Map<String, Object> indexDocument = getIndexDocument(message, relationMap, false, indexableProps);
String jsonIndexDocument = mapper.writeValueAsString(indexDocument);
try {
System.out.println("New Content Request::");
System.out.println(jsonIndexDocument);
} catch (Exception e) {
e.printStackTrace();
}
upsertDocument(uniqueId, jsonIndexDocument);
break;
}
case CompositeSearchConstants.OPERATION_UPDATE: {
Map<String, Object> indexDocument = getIndexDocument(message, relationMap, true, indexableProps);
String jsonIndexDocument = mapper.writeValueAsString(indexDocument);
try {
System.out.println("Update Content Request::");
System.out.println(jsonIndexDocument);
} catch (Exception e) {
e.printStackTrace();
}
upsertDocument(uniqueId, jsonIndexDocument);
break;
}
Expand Down Expand Up @@ -252,6 +264,9 @@ private List<String> getIndexableProperties(Map<String, Object> definition) {
}

private void addMetadataToDocument(Map.Entry<String, Object> propertyMap, String propertyName, Map<String, Object> indexDocument) throws Exception {
System.out.println("Nested : field values and Property Name");
System.out.println(nestedFields);
System.out.println(propertyName);
// new value of the property
Object propertyNewValue = ((Map<String, Object>) propertyMap.getValue()).get("nv");
// New value from transaction data is null, then remove the property from document
Expand Down