feat: Define a DocIndex struct

This commit is contained in:
Clément Renault 2018-05-27 11:15:05 +02:00
parent a2958250c5
commit 3a194bfcc7
3 changed files with 69 additions and 21 deletions

View file

@ -16,10 +16,10 @@ use tokio_minihttp::{Request, Response, Http};
use tokio_proto::TcpServer;
use tokio_service::Service;
use raptor::{Map, OpWithStateBuilder, LevBuilder, Value};
use raptor::{DocIndexMap, OpWithStateBuilder, LevBuilder};
struct MainService {
map: Arc<Map<Value>>,
map: Arc<DocIndexMap>,
lev_builder: Arc<LevBuilder>,
}
@ -92,7 +92,7 @@ fn main() {
let map = {
let fst = fs::read("map.fst").unwrap();
let values = fs::read("values.vecs").unwrap();
let map = Map::from_bytes(fst, &values).unwrap();
let map = DocIndexMap::from_bytes(fst, &values).unwrap();
Arc::new(map)
};