Skip to content
Merged
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 @@ -379,8 +379,10 @@ public List<Document> doSimilaritySearch(SearchRequest request) {
JsonObject metadata = new JsonObject();
try {
metadata = (JsonObject) rowRecord.get(this.metadataFieldName);
// inject the distance into the metadata.
metadata.addProperty(DocumentMetadata.DISTANCE.value(), 1 - getResultSimilarity(rowRecord));
if (metadata != null) {
// inject the distance into the metadata.
metadata.addProperty(DocumentMetadata.DISTANCE.value(), 1 - getResultSimilarity(rowRecord));
}
}
catch (ParamException e) {
// skip the ParamException if metadata doesn't exist for the custom
Expand Down