mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-27 12:32:55 +00:00
wrapped intermediate extended stat with a box to limit memory usage
This commit is contained in:
@@ -216,7 +216,7 @@ pub(crate) fn empty_from_req(req: &Aggregation) -> IntermediateAggregationResult
|
||||
IntermediateStats::default(),
|
||||
)),
|
||||
ExtendedStats(_) => IntermediateAggregationResult::Metric(
|
||||
IntermediateMetricResult::ExtendedStats(IntermediateExtendedStats::default()),
|
||||
IntermediateMetricResult::ExtendedStats(Box::new(IntermediateExtendedStats::default())),
|
||||
),
|
||||
Sum(_) => IntermediateAggregationResult::Metric(IntermediateMetricResult::Sum(
|
||||
IntermediateSum::default(),
|
||||
@@ -286,7 +286,7 @@ pub enum IntermediateMetricResult {
|
||||
/// Intermediate stats result.
|
||||
Stats(IntermediateStats),
|
||||
/// Intermediate stats result.
|
||||
ExtendedStats(IntermediateExtendedStats),
|
||||
ExtendedStats(Box<IntermediateExtendedStats>),
|
||||
/// Intermediate sum result.
|
||||
Sum(IntermediateSum),
|
||||
/// Intermediate top_hits result
|
||||
@@ -358,7 +358,7 @@ impl IntermediateMetricResult {
|
||||
IntermediateMetricResult::ExtendedStats(extended_stats_left),
|
||||
IntermediateMetricResult::ExtendedStats(extended_stats_right),
|
||||
) => {
|
||||
extended_stats_left.merge_fruits(extended_stats_right);
|
||||
extended_stats_left.merge_fruits(*extended_stats_right);
|
||||
}
|
||||
(IntermediateMetricResult::Sum(sum_left), IntermediateMetricResult::Sum(sum_right)) => {
|
||||
sum_left.merge_fruits(sum_right);
|
||||
|
||||
@@ -770,7 +770,7 @@ impl SegmentAggregationCollector for SegmentExtendedStatsCollector {
|
||||
let name = agg_with_accessor.aggs.keys[self.accessor_idx].to_string();
|
||||
results.push(
|
||||
name,
|
||||
IntermediateAggregationResult::Metric(IntermediateMetricResult::ExtendedStats(self.extended_stats)),
|
||||
IntermediateAggregationResult::Metric(IntermediateMetricResult::ExtendedStats(Box::new(self.extended_stats))),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user