From 736f0f75603d9be2fdbc23d4a53733042e3cf85f Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Fri, 26 Jun 2020 14:51:00 +0200 Subject: [PATCH] Use the proximity instead of the attributes when searching for <= 7 proximities --- src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4dcab81d8..fc68d7439 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -195,9 +195,8 @@ impl Index { let lunion_docids = union_cache.get(&(lword, lpos)).unwrap(); let runion_docids = union_cache.get(&(rword, rpos)).unwrap(); - let lattr = lpos / 1000; - let rattr = rpos / 1000; - if lattr == rattr { + if proximity <= 7 { + let lattr = lpos / 1000; if let Some(docids) = &words_attributes_docids[lattr as usize] { if lunion_docids.is_disjoint(&docids) { return false } if runion_docids.is_disjoint(&docids) { return false }