From b0b42054363f5bf4d96a2ed8637c9654b95d6cc9 Mon Sep 17 00:00:00 2001 From: Darren Li Date: Mon, 18 Sep 2023 02:07:51 +1000 Subject: [PATCH] Fixing search ranking --- lib/search_result.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/search_result.ml b/lib/search_result.ml index db93969..9f69c81 100644 --- a/lib/search_result.ml +++ b/lib/search_result.ml @@ -224,10 +224,10 @@ let score (t : t) : float = (stats.ci_exact_match_found_char_count /. total_char_count)) +. (sub_match_score - *. (stats.sub_match_total_char_count /. total_char_count)) + *. (stats.sub_match_overlap_char_count /. total_char_count)) +. (ci_sub_match_score - *. (stats.ci_sub_match_total_char_count /. total_char_count)) + *. (stats.ci_sub_match_overlap_char_count /. total_char_count)) +. (fuzzy_match_score *. (stats.fuzzy_match_found_char_count /. total_char_count))