feat: Fix the ranking algorithm to sort only the needed documents

This commit is contained in:
Kerollmops
2018-06-25 22:26:49 +02:00
committed by Clément Renault
parent 0190caef4d
commit 23134fee02
7 changed files with 156 additions and 230 deletions

View File

@ -3,8 +3,7 @@ extern crate fst;
extern crate raptor;
extern crate elapsed;
use std::{env, fs};
use std::process::Command;
use std::env;
use std::io::{self, Write};
use elapsed::measure_time;
use fst::Streamer;
@ -21,7 +20,8 @@ fn search(map: &DocIndexMap, lev_builder: &LevBuilder, query: &str) {
while let Some(document_id) = stream.next() {
print!("{:?}", document_id);
/* only here to debug !
// /* only here to debug !
use std::{fs, process::Command};
if let Ok(_) = fs::File::open("products.json_lines") {
let output = Command::new("rg")
.arg(document_id.to_string())