From e43dce727486fe557050bd9e258268a87851b726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Wed, 26 Sep 2018 15:08:42 +0200 Subject: [PATCH] fix: Lowercase the query --- raptor-http/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/raptor-http/src/main.rs b/raptor-http/src/main.rs index 9a71cce24..9e81f36d5 100644 --- a/raptor-http/src/main.rs +++ b/raptor-http/src/main.rs @@ -61,8 +61,9 @@ where M: AsRef, D: AsRef, { let mut automatons = Vec::new(); - for query in query.split_whitespace().filter(|q| !common_words.contains(*q)) { - let lev = automaton::build(query); + for query in query.split_whitespace().map(str::to_lowercase) { + if common_words.contains(&query) { continue } + let lev = automaton::build(&query); automatons.push(lev); }