RED-3774: Always prefer entities over recommendactions

This commit is contained in:
deiflaender 2022-04-20 11:51:12 +02:00
parent 5d8f44d55d
commit ecf794ff37

View File

@ -223,6 +223,13 @@ public class EntitySearchUtils {
if (existing.getType().equals(found.getType())) {
existing.getEngines().addAll(found.getEngines());
if(existing.getEntityType().equals(EntityType.RECOMMENDATION) && found.getEntityType().equals(EntityType.ENTITY)
|| existing.getEntityType().equals(EntityType.ENTITY) && found.getEntityType().equals(EntityType.RECOMMENDATION)){
existing.setEntityType(EntityType.ENTITY);
if(found.isRedaction()){
existing.setRedaction(true);
}
}
} else if (dictionary.getDictionaryRank(existing.getType()) <= dictionary.getDictionaryRank(found.getType())) {
entities.remove(found);
entities.add(found);