From 31607bf9cd223df41c61651d6b1c9384bc4e50bd Mon Sep 17 00:00:00 2001 From: many Date: Tue, 27 Apr 2021 14:53:37 +0200 Subject: [PATCH] Add a threshold on proximity when choosing between linear/set algorithm --- milli/src/search/criteria/proximity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/milli/src/search/criteria/proximity.rs b/milli/src/search/criteria/proximity.rs index 4c73d7459..4ed6dd401 100644 --- a/milli/src/search/criteria/proximity.rs +++ b/milli/src/search/criteria/proximity.rs @@ -55,7 +55,7 @@ impl<'t> Criterion for Proximity<'t> { if self.proximity as usize > *max_prox { self.state = None; // reset state } else { - let mut new_candidates = if candidates.len() <= 1000 { + let mut new_candidates = if candidates.len() <= 1000 && self.proximity > 0 { if let Some(cache) = self.plane_sweep_cache.as_mut() { match cache.next() { Some((p, candidates)) => {