From 36c1f93ceb969c69bb37b252e8369169670c1767 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 25 Feb 2021 17:28:20 +0100 Subject: [PATCH] Do an union of the bucket candidates --- milli/src/search/criteria/asc_desc.rs | 2 +- milli/src/search/criteria/proximity.rs | 2 +- milli/src/search/criteria/typo.rs | 2 +- milli/src/search/criteria/words.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/milli/src/search/criteria/asc_desc.rs b/milli/src/search/criteria/asc_desc.rs index 3d32bd845..df80f3bb4 100644 --- a/milli/src/search/criteria/asc_desc.rs +++ b/milli/src/search/criteria/asc_desc.rs @@ -174,7 +174,7 @@ impl<'t> Criterion for AscDesc<'t> { self.query_tree = query_tree; candidates.intersect_with(&self.faceted_candidates); self.candidates = Candidates::Allowed(candidates); - self.bucket_candidates = bucket_candidates; + self.bucket_candidates.union_with(&bucket_candidates); }, None => return Ok(None), } diff --git a/milli/src/search/criteria/proximity.rs b/milli/src/search/criteria/proximity.rs index 57c7007fc..352567d1a 100644 --- a/milli/src/search/criteria/proximity.rs +++ b/milli/src/search/criteria/proximity.rs @@ -139,7 +139,7 @@ impl<'t> Criterion for Proximity<'t> { self.query_tree = query_tree.map(|op| (maximum_proximity(&op), op)); self.proximity = 0; self.candidates = Candidates::Allowed(candidates); - self.bucket_candidates = bucket_candidates; + self.bucket_candidates.union_with(&bucket_candidates); }, None => return Ok(None), } diff --git a/milli/src/search/criteria/typo.rs b/milli/src/search/criteria/typo.rs index 0b8111997..b82ebbf5b 100644 --- a/milli/src/search/criteria/typo.rs +++ b/milli/src/search/criteria/typo.rs @@ -147,7 +147,7 @@ impl<'t> Criterion for Typo<'t> { self.query_tree = query_tree.map(|op| (maximum_typo(&op), op)); self.number_typos = 0; self.candidates = Candidates::Allowed(candidates); - self.bucket_candidates = bucket_candidates; + self.bucket_candidates.union_with(&bucket_candidates); }, None => return Ok(None), } diff --git a/milli/src/search/criteria/words.rs b/milli/src/search/criteria/words.rs index 0913d429d..c8bb0abc4 100644 --- a/milli/src/search/criteria/words.rs +++ b/milli/src/search/criteria/words.rs @@ -107,7 +107,7 @@ impl<'t> Criterion for Words<'t> { Some(CriterionResult { query_tree, candidates, bucket_candidates }) => { self.query_trees = query_tree.map(explode_query_tree).unwrap_or_default(); self.candidates = Candidates::Allowed(candidates); - self.bucket_candidates = bucket_candidates; + self.bucket_candidates.union_with(&bucket_candidates); }, None => return Ok(None), }