From 626f69737e9bc1742a3d89c4a9226dd01321d84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sat, 15 Sep 2018 21:03:18 +0200 Subject: [PATCH] fix: Prefer using the group_id instead of the product_id The product_id is an id that identify each group variant (e.g. color, size...), it is not useful for the relevance for the moment. --- raptor-indexer/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/raptor-indexer/src/main.rs b/raptor-indexer/src/main.rs index 056effa1f..a6da19cbb 100644 --- a/raptor-indexer/src/main.rs +++ b/raptor-indexer/src/main.rs @@ -17,7 +17,7 @@ use unidecode::unidecode; #[derive(Debug, Deserialize)] struct Product { title: String, - product_id: u64, + group_id: u64, ft: String, } @@ -76,7 +76,7 @@ fn main() { let words = title.chain(description); for (i, (attr, word)) in words { let doc_index = DocIndex { - document: product.product_id, + document: product.group_id, attribute: attr, attribute_index: i as u32, }; @@ -95,11 +95,11 @@ fn main() { // TODO simplify this by using functions and // use the MetadataBuilder internal BTreeMap ? - let key = format!("{}-title", product.product_id); + let key = format!("{}-title", product.group_id); let value = product.title; fields.insert(key, value); - let key = format!("{}-description", product.product_id); + let key = format!("{}-description", product.group_id); let value = product.ft; fields.insert(key, value); }