From 709ab3c14c511178c61de6f662e659d7047b0180 Mon Sep 17 00:00:00 2001 From: Samyak S Sarnayak Date: Thu, 13 Oct 2022 22:40:25 +0530 Subject: [PATCH] Increment position even when it's a stop word in exactness criteria --- milli/src/search/criteria/exactness.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/milli/src/search/criteria/exactness.rs b/milli/src/search/criteria/exactness.rs index 0f0c24723..580031697 100644 --- a/milli/src/search/criteria/exactness.rs +++ b/milli/src/search/criteria/exactness.rs @@ -298,10 +298,12 @@ fn attribute_start_with_docids( pos += 1; } Phrase(phrase) => { - for word in phrase.iter().filter_map(|w| w.as_ref()) { - let wc = ctx.word_position_docids(word, pos)?; - if let Some(word_candidates) = wc { - attribute_candidates_array.push(word_candidates); + for word in phrase { + if let Some(word) = word { + let wc = ctx.word_position_docids(word, pos)?; + if let Some(word_candidates) = wc { + attribute_candidates_array.push(word_candidates); + } } pos += 1; }