From 3d731cc861a1799e0b14288443a2e7668d7bb83b Mon Sep 17 00:00:00 2001 From: many Date: Thu, 25 Feb 2021 16:47:34 +0100 Subject: [PATCH] remove option on bucket_candidates --- milli/src/search/criteria/asc_desc.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/milli/src/search/criteria/asc_desc.rs b/milli/src/search/criteria/asc_desc.rs index bf75ada7e..3d32bd845 100644 --- a/milli/src/search/criteria/asc_desc.rs +++ b/milli/src/search/criteria/asc_desc.rs @@ -21,7 +21,7 @@ pub struct AscDesc<'t> { ascending: bool, query_tree: Option, candidates: Candidates, - bucket_candidates: Option, + bucket_candidates: RoaringBitmap, faceted_candidates: RoaringBitmap, parent: Option>, } @@ -92,7 +92,7 @@ impl<'t> AscDesc<'t> { query_tree, candidates: candidates.map_or_else(Candidates::default, Candidates::Allowed), faceted_candidates: index.faceted_documents_ids(rtxn, field_id)?, - bucket_candidates: None, + bucket_candidates: RoaringBitmap::new(), parent: None, }) } @@ -115,7 +115,7 @@ impl<'t> AscDesc<'t> { query_tree: None, candidates: Candidates::default(), faceted_candidates: index.faceted_documents_ids(rtxn, field_id)?, - bucket_candidates: None, + bucket_candidates: RoaringBitmap::new(), parent: Some(parent), }) } @@ -133,8 +133,8 @@ impl<'t> Criterion for AscDesc<'t> { }, (Some(qt), Allowed(candidates)) => { let bucket_candidates = match self.parent { - Some(_) => self.bucket_candidates.take(), - None => Some(candidates.clone()), + Some(_) => take(&mut self.bucket_candidates), + None => candidates.clone(), }; let mut found_candidates = facet_ordered( @@ -163,7 +163,7 @@ impl<'t> Criterion for AscDesc<'t> { return Ok(Some(CriterionResult { query_tree: None, candidates: candidates.clone(), - bucket_candidates: Some(candidates), + bucket_candidates: candidates, })); }, (None, Forbidden(_)) => {