From 0b6ef19c1532209dcd2a18e6bbbaa23cad353008 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 30 Oct 2022 18:11:42 +0100 Subject: Indexer: Transform all queries into lowercase This is because currently then reverse index only contains lowercase words as it transforms them when inserting them. --- indexer/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indexer/src/main.rs b/indexer/src/main.rs index 18604a6..36bd8de 100644 --- a/indexer/src/main.rs +++ b/indexer/src/main.rs @@ -106,6 +106,9 @@ async fn search(data: web::Data, term: web::Path) -> impl Resp //percentage of valid words let mut valid_results: Option> = None; for w in query { + //Normalise queries to lowercase + let w = w.to_ascii_lowercase(); + let curr_word_results = match search_word_in_db(&database, w.to_string()) { None => return "[]".to_string(), Some(curr_results) => curr_results, -- cgit 1.4.1