|
|
@@ -69,10 +69,10 @@ fn run_bench(index_path: &Path, |
|
|
|
let query = query_parser.parse_query(&query_txt).unwrap(); |
|
|
|
let num_terms = query.num_terms(); |
|
|
|
let mut top_collector = TopCollector::with_limit(10); |
|
|
|
let mut count_collector = CountCollector::new(); |
|
|
|
let mut count_collector = CountCollector::default(); |
|
|
|
let timing; |
|
|
|
{ |
|
|
|
let mut collector = chain().add(&mut top_collector).add(&mut count_collector); |
|
|
|
let mut collector = chain().push(&mut top_collector).push(&mut count_collector); |
|
|
|
timing = try!(query.search(&searcher, &mut collector).map_err(|e| format!("Failed while searching query {:?}.\n\n{:?}", query_txt, e))); |
|
|
|
} |
|
|
|
println!("{}\t{}\t{}\t{}", query_txt, num_terms, count_collector.count(), timing.total_time()); |
|
|
@@ -87,7 +87,7 @@ fn run_bench(index_path: &Path, |
|
|
|
let query = query_parser.parse_query(&query_txt).unwrap(); |
|
|
|
let mut top_collector = TopCollector::with_limit(10); |
|
|
|
try!(query.search(&searcher, &mut top_collector).map_err(|e| format!("Failed while retrieving document for query {:?}.\n{:?}", query, e))); |
|
|
|
let mut timer = TimerTree::new(); |
|
|
|
let mut timer = TimerTree::default(); |
|
|
|
{ |
|
|
|
let _scoped_timer_ = timer.open("total"); |
|
|
|
for doc_address in top_collector.docs() { |
|
|
|