Use the proximity instead of the attributes when searching for <= 7 proximities

This commit is contained in:
Kerollmops 2020-06-26 14:51:00 +02:00
parent fe3be8f18a
commit 736f0f7560
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -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 }