From 4e6516ccf179c15240c36b1491223be0ddad650b Mon Sep 17 00:00:00 2001 From: Daoud Clarke Date: Fri, 25 Feb 2022 22:14:49 +0000 Subject: [PATCH] Scale by 0.99 --- mwmbl/tinysearchengine/rank.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mwmbl/tinysearchengine/rank.py b/mwmbl/tinysearchengine/rank.py index dae1dc9..c3ee9e8 100644 --- a/mwmbl/tinysearchengine/rank.py +++ b/mwmbl/tinysearchengine/rank.py @@ -50,7 +50,7 @@ def _score_result(terms, result: Document, is_complete: bool, max_score: float): total_possible_match_length = sum(len(x) for x in terms) match_score = (match_length + 1. / last_match_char) / (total_possible_match_length + 1) # score = 0.1 * domain_score + 0.9 - score = (0.1 + 0.9*match_score) * (0.1 + 0.9*(result.score / max_score)) + score = (0.01 + 0.99*match_score) * (0.01 + 0.99*(result.score / max_score)) return score