From b15519e4c4f52beef26cca38ee31a4a147eeaa3d Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Sun, 31 Jul 2016 12:04:53 +0900 Subject: [PATCH] blop --- Cargo.toml | 10 ++++++---- src/main.rs | 8 ++++---- static/index.html | 2 +- static/style.less | 3 ++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 79877ad..1e83dc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,11 +7,13 @@ authors = ["Paul Masurel "] [dependencies] tantivy = { path = "../tantivy" } time = "0.1.34" -iron = "0.3.0" -staticfile = "*" -mount= "*" +iron = "0.4" +staticfile = "0.3.0" lazy_static = "*" rustc-serialize = "0.3.16" [dependencies.urlencoded] -version = "*" +version = "0.4" + +[dependencies.mount] +git = "https://github.com/iron/mount.git" diff --git a/src/main.rs b/src/main.rs index f340b0b..58f5310 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,11 +9,11 @@ extern crate staticfile; extern crate mount; use tantivy::schema::Field; -use tantivy::collector::{CountCollector, MultiCollector}; +use tantivy::collector::CountCollector; use tantivy::Index; use std::convert::From; use time::PreciseTime; -use tantivy::collector::chain; +use tantivy::collector; use urlencoded::UrlEncodedQuery; use iron::status; use rustc_serialize::json::as_pretty_json; @@ -43,7 +43,7 @@ struct Hit { lazy_static! { static ref INDEX_SERVER: IndexServer = { - IndexServer::load(&Path::new("/Users/pmasurel/wiki-index/")) + IndexServer::load(&Path::new("/data/wiki-index/")) }; } @@ -123,7 +123,7 @@ fn search(req: &mut Request) -> IronResult { { // let mut multi_collector = MultiCollector::from(vec!(&mut count_collector, &mut top_collector)); - let mut chained_collector = chain() + let mut chained_collector = collector::chain() .add(&mut top_collector) .add(&mut count_collector); let timings = parsed_query.search(&searcher, &mut chained_collector).unwrap(); diff --git a/static/index.html b/static/index.html index 2097839..c2206dd 100644 --- a/static/index.html +++ b/static/index.html @@ -10,7 +10,7 @@
{{ num_hits }} articles
    {{#timings}} -
  • {{name}} - {{duration}} µs
  • +
  • {{name}} - {{duration}} μs
  • {{/timings}}
diff --git a/static/style.less b/static/style.less index 57483bc..0fede6f 100644 --- a/static/style.less +++ b/static/style.less @@ -9,7 +9,6 @@ body { input, button { font-size: 20px; - //height: 45px; padding: 5px; } @@ -38,6 +37,8 @@ div.query { } ul.hits { + margin-top: 30px; + clear: both; padding: 0; list-style-type: none; li {