From d8ad4f5063bcb7ba9d201578b8c693b2b6f1e2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sat, 15 Sep 2018 20:58:05 +0200 Subject: [PATCH] feat: Add a way to choose the indexed json lines file --- raptor-indexer/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/raptor-indexer/src/main.rs b/raptor-indexer/src/main.rs index 6609ab3f3..056effa1f 100644 --- a/raptor-indexer/src/main.rs +++ b/raptor-indexer/src/main.rs @@ -7,7 +7,7 @@ use std::path::Path; use std::collections::{HashSet, BTreeMap}; use std::io::{self, BufReader, BufRead}; use std::fs::File; -use std::iter; +use std::{env, iter}; use raptor::{MetadataBuilder, DocIndex}; use rocksdb::{SstFileWriter, EnvOptions, ColumnFamilyOptions}; @@ -38,7 +38,8 @@ where P: AsRef, } fn main() { - let data = File::open("products.json_lines").unwrap(); + let data_path = env::args().nth(1).expect("Missing data json lines file (e.g. products.json_lines)"); + let data = File::open(data_path).unwrap(); let data = BufReader::new(data); let common_path = "fr.stopwords.txt";