From a291345e5bd479e28b365706973d6246ac96b91f Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Wed, 16 Nov 2016 09:52:42 +0900 Subject: [PATCH] BUGFIX put indexed text fields in default schema --- src/commands/serve.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/serve.rs b/src/commands/serve.rs index d799763..1ff2e53 100644 --- a/src/commands/serve.rs +++ b/src/commands/serve.rs @@ -83,7 +83,9 @@ impl IndexServer { .filter( |&(_, ref field_entry)| { 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 } } @@ -105,7 +107,7 @@ impl IndexServer { } fn search(&self, q: String, num_hits: usize, explain: bool) -> tantivy::Result { - 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 mut count_collector = CountCollector::default(); let mut top_collector = TopCollector::with_limit(num_hits);