set default threshold of the strategy to 1
@@ -41,7 +41,7 @@ public class ScorePersonalizationStrategy implements PersonalizationStrategy {
Integer threshold = (Integer) personalizationRequest.getStrategyOptions().get("threshold");
if (threshold == null) {
- threshold = 0;
+ threshold = 1;
}
for (PersonalizationService.PersonalizedContent personalizedContent : personalizationRequest.getContents()) {
@@ -67,13 +67,11 @@ public class ScorePersonalizationStrategy implements PersonalizationStrategy {
}
}
- boolean matchesAtLeastOneCondition = false;
if (personalizedContent.getFilters() != null) {
for (PersonalizationService.Filter filter : personalizedContent.getFilters()) {
Condition condition = filter.getCondition();
if (condition != null && condition.getConditionTypeId() != null) {
if (profileService.matchCondition(condition, profile, session)) {
- matchesAtLeastOneCondition = true;
if (filter.getProperties().get("score") != null) {
score += (int) filter.getProperties().get("score");
} else {
@@ -83,7 +81,7 @@ public class ScorePersonalizationStrategy implements PersonalizationStrategy {
}
}
}
- if (matchesAtLeastOneCondition && score >= threshold) {
+ if (score >= threshold) {
t.put(personalizedContent.getId(), score);
sortedContent.add(personalizedContent.getId());
}
