From 5465e401bbb7e2cd82fe7acf26eeb96d499d6b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Fri, 17 Jan 2020 10:41:27 +0100 Subject: [PATCH] Catch query tree related errors --- meilisearch-core/src/bucket_sort.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meilisearch-core/src/bucket_sort.rs b/meilisearch-core/src/bucket_sort.rs index ef22cafd3..59bb65176 100644 --- a/meilisearch-core/src/bucket_sort.rs +++ b/meilisearch-core/src/bucket_sort.rs @@ -75,7 +75,7 @@ where prefix_postings_lists: prefix_postings_lists_cache_store, }; - let (operation, mapping) = create_query_tree(reader, &context, query).unwrap(); + let (operation, mapping) = create_query_tree(reader, &context, query)?; debug!("operation:\n{:?}", operation); debug!("mapping:\n{:?}", mapping); @@ -90,7 +90,7 @@ where let mut queries_kinds = HashMap::new(); recurs_operation(&mut queries_kinds, &operation); - let QueryResult { docids, queries } = traverse_query_tree(reader, &context, &operation).unwrap(); + let QueryResult { docids, queries } = traverse_query_tree(reader, &context, &operation)?; println!("found {} documents", docids.len()); println!("number of postings {:?}", queries.len()); @@ -202,7 +202,7 @@ where prefix_postings_lists: prefix_postings_lists_cache_store, }; - let (operation, mapping) = create_query_tree(reader, &context, query).unwrap(); + let (operation, mapping) = create_query_tree(reader, &context, query)?; debug!("operation:\n{:?}", operation); debug!("mapping:\n{:?}", mapping); @@ -217,7 +217,7 @@ where let mut queries_kinds = HashMap::new(); recurs_operation(&mut queries_kinds, &operation); - let QueryResult { docids, queries } = traverse_query_tree(reader, &context, &operation).unwrap(); + let QueryResult { docids, queries } = traverse_query_tree(reader, &context, &operation)?; println!("found {} documents", docids.len()); println!("number of postings {:?}", queries.len());