From 8689125ed9b09f73781d3babfd65537c0b1f4afe Mon Sep 17 00:00:00 2001 From: deiflaender Date: Tue, 1 Feb 2022 11:06:32 +0100 Subject: [PATCH] RED-3327: Ignore recommendations if touches other type --- .../v1/server/redaction/utils/EntitySearchUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/utils/EntitySearchUtils.java b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/utils/EntitySearchUtils.java index cbec49f9..1462bb36 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/utils/EntitySearchUtils.java +++ b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/utils/EntitySearchUtils.java @@ -128,7 +128,12 @@ public class EntitySearchUtils { for (Entity inner : entities) { if (inner.getWord().length() < word.getWord() .length() && inner.getStart() >= word.getStart() && inner.getEnd() <= word.getEnd() && word != inner && word.getSectionNumber() == inner.getSectionNumber()) { - wordsToRemove.add(inner); + // FIXME this is workaround for RED-3327 and should be removed in the future. + if(word.getType().contains("recommendation_") && !inner.getType().contains("recommendation_")) { + wordsToRemove.add(word); + } else { + wordsToRemove.add(inner); + } } } }