diff --git a/milli/src/search/criteria/typo.rs b/milli/src/search/criteria/typo.rs index 56cffd232..20bc718fd 100644 --- a/milli/src/search/criteria/typo.rs +++ b/milli/src/search/criteria/typo.rs @@ -141,7 +141,12 @@ impl<'t> Criterion for Typo<'t> { filtered_candidates, initial_candidates, }) => { - self.initial_candidates = initial_candidates; + self.initial_candidates = + match (self.initial_candidates.take(), initial_candidates) { + (Some(self_ic), Some(parent_ic)) => Some(self_ic | parent_ic), + (self_ic, parent_ic) => self_ic.or(parent_ic), + }; + let candidates = match candidates.or(filtered_candidates) { Some(candidates) => { Candidates::Allowed(candidates - params.excluded_candidates) diff --git a/milli/src/search/criteria/words.rs b/milli/src/search/criteria/words.rs index 181749b60..4c5f8b45b 100644 --- a/milli/src/search/criteria/words.rs +++ b/milli/src/search/criteria/words.rs @@ -74,8 +74,8 @@ impl<'t> Criterion for Words<'t> { self.initial_candidates = match (self.initial_candidates.take(), initial_candidates) { - (Some(self_bc), Some(parent_bc)) => Some(self_bc | parent_bc), - (self_bc, parent_bc) => self_bc.or(parent_bc), + (Some(self_ic), Some(parent_ic)) => Some(self_ic | parent_ic), + (self_ic, parent_ic) => self_ic.or(parent_ic), }; } Some(CriterionResult {