From 1a3b444d71db117d932dd3140da35ba7d8f2593d Mon Sep 17 00:00:00 2001 From: Pascal Seitz Date: Fri, 24 Jun 2022 14:18:17 +0800 Subject: [PATCH] fix visibility --- src/aggregation/collector.rs | 2 ++ src/aggregation/intermediate_agg_result.rs | 5 +---- src/aggregation/mod.rs | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aggregation/collector.rs b/src/aggregation/collector.rs index c9510d9263..f3638fae82 100644 --- a/src/aggregation/collector.rs +++ b/src/aggregation/collector.rs @@ -9,6 +9,7 @@ use crate::aggregation::agg_req_with_accessor::get_aggs_with_accessor_and_valida use crate::collector::{Collector, SegmentCollector}; use crate::{SegmentReader, TantivyError}; +/// The default max bucket count, before the aggregation fails. pub const MAX_BUCKET_COUNT: u32 = 65000; /// Collector for aggregations. @@ -22,6 +23,7 @@ pub struct AggregationCollector { impl AggregationCollector { /// Create collector from aggregation request. /// + /// Aggregation fails when the total bucket count is higher than max_bucket_count. /// max_bucket_count will default to `MAX_BUCKET_COUNT` (65000) when unset pub fn from_aggs(agg: Aggregations, max_bucket_count: Option) -> Self { Self { diff --git a/src/aggregation/intermediate_agg_result.rs b/src/aggregation/intermediate_agg_result.rs index 20eef59c07..97a5955c2c 100644 --- a/src/aggregation/intermediate_agg_result.rs +++ b/src/aggregation/intermediate_agg_result.rs @@ -36,10 +36,7 @@ pub struct IntermediateAggregationResults { impl IntermediateAggregationResults { /// Convert intermediate result and its aggregation request to the final result. - pub(crate) fn into_final_bucket_result( - self, - req: Aggregations, - ) -> crate::Result { + pub fn into_final_bucket_result(self, req: Aggregations) -> crate::Result { self.into_final_bucket_result_internal(&(req.into())) } diff --git a/src/aggregation/mod.rs b/src/aggregation/mod.rs index 7f6f8378ce..69ae782db7 100644 --- a/src/aggregation/mod.rs +++ b/src/aggregation/mod.rs @@ -166,6 +166,7 @@ use std::fmt::Display; pub use collector::{ AggregationCollector, AggregationSegmentCollector, DistributedAggregationCollector, + MAX_BUCKET_COUNT, }; use itertools::Itertools; use serde::{Deserialize, Serialize};