(rank) Reduce the impact of domain rank bonus, and only apply it to cancel out negative penalties, never to increase the ranking

This commit is contained in:
Viktor Lofgren 2024-12-10 22:04:12 +01:00
parent 9fc82574f0
commit cf7f84f033
2 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ public class ResultRankingParameters {
.bm25Params(new Bm25Parameters(1.2, 0.5))
.shortDocumentThreshold(2000)
.shortDocumentPenalty(2.)
.domainRankBonus(1 / 25.)
.domainRankBonus(1 / 100.)
.qualityPenalty(1 / 15.)
.shortSentenceThreshold(2)
.shortSentencePenalty(5)

View File

@ -129,9 +129,9 @@ public class IndexResultScoreCalculator {
double score = normalize(
score_firstPosition + score_proximity + score_verbatim
+ score_bM25
+ score_bFlags
+ Math.max(0, documentBonus),
-Math.min(0, documentBonus));
+ score_bFlags,
-Math.min(0, documentBonus) // The magnitude of documentBonus, if it is negative; otherwise 0
);
if (Double.isNaN(score)) { // This should never happen but if it does, we want to know about it
if (getClass().desiredAssertionStatus()) {