From cf203b7fde8ddbdf711cde6f53ef0298fc3af8d9 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Wed, 20 Jul 2022 15:58:26 +0200 Subject: [PATCH] Take filter in account when computing the pages candidates --- milli/src/search/criteria/initial.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/milli/src/search/criteria/initial.rs b/milli/src/search/criteria/initial.rs index bae77fda0..9a9565182 100644 --- a/milli/src/search/criteria/initial.rs +++ b/milli/src/search/criteria/initial.rs @@ -38,12 +38,16 @@ impl Criterion for Initial<'_, D> { .take() .map(|mut answer| { if self.exhaustive_number_hits && answer.query_tree.is_some() { - let candidates = resolve_query_tree( + let mut candidates = resolve_query_tree( self.ctx, answer.query_tree.as_ref().unwrap(), &mut params.wdcache, )?; + if let Some(ref filtered_candidates) = answer.filtered_candidates { + candidates &= filtered_candidates; + } + let bucket_candidates = match &mut self.distinct { // may be really time consuming Some(distinct) => {