diff --git a/examples/fuzzy_search.rs b/examples/fuzzy_search.rs index 541656d125..584a19b6a0 100644 --- a/examples/fuzzy_search.rs +++ b/examples/fuzzy_search.rs @@ -9,15 +9,12 @@ // - index a few documents into our index // - search for the best document matching a basic query // - retrieve the best document's original content. - -use std::collections::HashSet; - // --- // Importing tantivy... use tantivy::collector::{Count, TopDocs}; -use tantivy::query::{FuzzyTermQuery, QueryParser}; +use tantivy::query::FuzzyTermQuery; use tantivy::schema::*; -use tantivy::{doc, DocId, Index, ReloadPolicy, Score, SegmentReader}; +use tantivy::{doc, Index, ReloadPolicy}; use tempfile::TempDir; fn main() -> tantivy::Result<()> { diff --git a/src/aggregation/segment_agg_result.rs b/src/aggregation/segment_agg_result.rs index 3e6bf6b3cb..402ce3199b 100644 --- a/src/aggregation/segment_agg_result.rs +++ b/src/aggregation/segment_agg_result.rs @@ -279,11 +279,7 @@ impl GenericSegmentAggregationResultsCollector { .iter() .enumerate() .map(|(accessor_idx, (_key, req))| { - Ok(build_bucket_segment_agg_collector( - req, - accessor_idx, - false, - )?) + build_bucket_segment_agg_collector(req, accessor_idx, false) }) .collect::>>>()?; let metrics = req @@ -291,13 +287,10 @@ impl GenericSegmentAggregationResultsCollector { .iter() .enumerate() .map(|(accessor_idx, (_key, req))| { - Ok(build_metric_segment_agg_collector( - req, - accessor_idx, - false, - )?) + build_metric_segment_agg_collector(req, accessor_idx, false) }) .collect::>>>()?; + let metrics = if metrics.is_empty() { None } else {