|
@@ -83,7 +83,9 @@ impl IndexServer { |
|
|
.filter( |
|
|
.filter( |
|
|
|&(_, ref field_entry)| { |
|
|
|&(_, ref field_entry)| { |
|
|
match *field_entry.field_type() { |
|
|
match *field_entry.field_type() { |
|
|
FieldType::Str(_) => true, |
|
|
|
|
|
|
|
|
FieldType::Str(ref text_field_options) => { |
|
|
|
|
|
text_field_options.get_indexing_options().is_indexed() |
|
|
|
|
|
}, |
|
|
FieldType::U32(_) => false |
|
|
FieldType::U32(_) => false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -105,7 +107,7 @@ impl IndexServer { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn search(&self, q: String, num_hits: usize, explain: bool) -> tantivy::Result<Serp> { |
|
|
fn search(&self, q: String, num_hits: usize, explain: bool) -> tantivy::Result<Serp> { |
|
|
let query = self.query_parser.parse_query(&q).unwrap(); |
|
|
|
|
|
|
|
|
let query = self.query_parser.parse_query(&q).expect("Parsing the query failed"); |
|
|
let searcher = self.index.searcher(); |
|
|
let searcher = self.index.searcher(); |
|
|
let mut count_collector = CountCollector::default(); |
|
|
let mut count_collector = CountCollector::default(); |
|
|
let mut top_collector = TopCollector::with_limit(num_hits); |
|
|
let mut top_collector = TopCollector::with_limit(num_hits); |
|
|