From 1c7a9a41326deefc5ff3c3e569f9b531798dd78f Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 24 Jun 2020 15:00:26 +0200 Subject: [PATCH] Remove the found documents from the candidates list --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index d3c99987e..9f9fcbedd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -242,6 +242,11 @@ impl Index { } } + // We achieve to find valid documents ids so we remove them from the candidate list. + for (_, docids) in &mut words_attributes_docids { + docids.difference_with(&same_proximity_union); + } + documents.push(same_proximity_union); // We remove the double occurences of documents.