From f95ab98a5be0a5100a80421e09b2f6e8cb066f11 Mon Sep 17 00:00:00 2001 From: capjamesg Date: Thu, 21 Nov 2024 09:39:15 +0000 Subject: [PATCH] work on ranking --- jamesql/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jamesql/index.py b/jamesql/index.py index 5409fec..a3997ec 100644 --- a/jamesql/index.py +++ b/jamesql/index.py @@ -938,7 +938,7 @@ def search( if found and field != "title_lower": # print(first_word_pos, doc["title"], field, "union") occurences = len(first_word_pos) - doc_scores[doc["uuid"]] *= 1 + (occurences / len(term_queries)) + doc_scores[doc["uuid"]] += len(first_word_pos) # * len(set(word_pos[term_queries[0]])) elif found and field == "title_lower": # get word overlap between title and terms