Catch query tree related errors

This commit is contained in:
Clément Renault 2020-01-17 10:41:27 +01:00
parent 9cc3c56c9c
commit 5465e401bb
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE

View File

@ -75,7 +75,7 @@ where
prefix_postings_lists: prefix_postings_lists_cache_store, 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!("operation:\n{:?}", operation);
debug!("mapping:\n{:?}", mapping); debug!("mapping:\n{:?}", mapping);
@ -90,7 +90,7 @@ where
let mut queries_kinds = HashMap::new(); let mut queries_kinds = HashMap::new();
recurs_operation(&mut queries_kinds, &operation); 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!("found {} documents", docids.len());
println!("number of postings {:?}", queries.len()); println!("number of postings {:?}", queries.len());
@ -202,7 +202,7 @@ where
prefix_postings_lists: prefix_postings_lists_cache_store, 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!("operation:\n{:?}", operation);
debug!("mapping:\n{:?}", mapping); debug!("mapping:\n{:?}", mapping);
@ -217,7 +217,7 @@ where
let mut queries_kinds = HashMap::new(); let mut queries_kinds = HashMap::new();
recurs_operation(&mut queries_kinds, &operation); 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!("found {} documents", docids.len());
println!("number of postings {:?}", queries.len()); println!("number of postings {:?}", queries.len());