diff --git a/crates/milli/src/search/new/matches/matching_words.rs b/crates/milli/src/search/new/matches/matching_words.rs index 64235298b..625dd2c77 100644 --- a/crates/milli/src/search/new/matches/matching_words.rs +++ b/crates/milli/src/search/new/matches/matching_words.rs @@ -174,7 +174,7 @@ impl<'a> PartialMatch<'a> { let is_matching = match matching_words.first()? { Some(word) => &token.lemma() == word, // a None value in the phrase corresponds to a stop word, - // the walue is considered a match if the current token is categorized as a stop word. + // the value is considered a match if the current token is categorized as a stop word. None => token.is_stopword(), }; diff --git a/crates/milli/src/search/new/resolve_query_graph.rs b/crates/milli/src/search/new/resolve_query_graph.rs index 3bbe699b2..62b47be24 100644 --- a/crates/milli/src/search/new/resolve_query_graph.rs +++ b/crates/milli/src/search/new/resolve_query_graph.rs @@ -194,7 +194,11 @@ pub fn compute_phrase_docids( return Ok(RoaringBitmap::new()); } let mut candidates = None; - for word in words.iter().flatten().copied() { + for word in words.iter().copied() { + let Some(word) = word else { + continue; + }; + if let Some(word_docids) = ctx.word_docids(None, Word::Original(word))? { if let Some(candidates) = candidates.as_mut() { *candidates &= word_docids;