Browse Source

Body and title as defautl field

develop
Paul Masurel 7 years ago
parent
commit
c8c899b154
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      src/main.rs

+ 2
- 3
src/main.rs View File

@@ -60,7 +60,7 @@ impl IndexServer {
let schema = index.schema();
let body_field = schema.get_field("body").unwrap();
let title_field = schema.get_field("title").unwrap();
let query_parser = QueryParser::new(schema, body_field);
let query_parser = QueryParser::new(schema, vec!(body_field, title_field));
IndexServer {
index: index,
query_parser: query_parser,
@@ -119,10 +119,9 @@ fn search(req: &mut Request) -> IronResult<Response> {
let searcher = INDEX_SERVER.index.searcher().unwrap();

let mut count_collector = CountCollector::new();
let mut top_collector = TopCollector::with_limit(10);
let mut top_collector = TopCollector::with_limit(30);

{
// let mut multi_collector = MultiCollector::from(vec!(&mut count_collector, &mut top_collector));
let mut chained_collector = collector::chain()
.add(&mut top_collector)
.add(&mut count_collector);


Loading…
Cancel
Save