|
@@ -46,15 +46,15 @@ public class CrawlerDaysDecreaseStrategy implements ScoreStrategy {
|
|
|
}
|
|
|
|
|
|
private Double getContentScore(Content content, long now) {
|
|
|
- double maxReleaseScore = -0.3;
|
|
|
+ double maxReleaseScore = -0.15;
|
|
|
+ double minScoreDays = 7;
|
|
|
double maxScoreDays = 60.0;
|
|
|
int days = (int) ((now - content.getCrawlerTimestamp()) / 86400000);
|
|
|
- if (days < 0) {
|
|
|
+ if (days < minScoreDays) {
|
|
|
return 0.0;
|
|
|
- } else if (days < maxScoreDays) {
|
|
|
- return maxReleaseScore * (days / maxScoreDays);
|
|
|
}
|
|
|
- return maxReleaseScore;
|
|
|
+ double scoreDays = Math.min(maxScoreDays, Math.max(minScoreDays, days));
|
|
|
+ return maxReleaseScore * ((scoreDays - minScoreDays) / maxScoreDays);
|
|
|
}
|
|
|
|
|
|
}
|