From b406fb4aed7aeb3ab761a11107a76fafe37bc2ff Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Sun, 24 Jun 2018 19:27:07 +0200 Subject: [PATCH] fix: Make sure to compute the right word index --- raptor-indexer/src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/raptor-indexer/src/main.rs b/raptor-indexer/src/main.rs index bc50f6894..4e1076226 100644 --- a/raptor-indexer/src/main.rs +++ b/raptor-indexer/src/main.rs @@ -60,12 +60,11 @@ fn main() { let product: Product = from_str(&line).unwrap(); - let title = iter::repeat(0).zip(product.title.split_whitespace()).enumerate(); - let description = iter::repeat(1).zip(product.ft.split_whitespace()).enumerate(); + let title = iter::repeat(0).zip(product.title.split_whitespace()).filter(|&(_, w)| !common_words.contains(w)).enumerate(); + let description = iter::repeat(1).zip(product.ft.split_whitespace()).filter(|&(_, w)| !common_words.contains(w)).enumerate(); let words = title.chain(description); for (i, (attr, word)) in words { - if common_words.contains(word) { continue } let doc_index = DocIndex { document: product.product_id, attribute: attr,