diff --git a/src/aggregation/agg_result.rs b/src/aggregation/agg_result.rs index bad0ea0f5..7755fe3b6 100644 --- a/src/aggregation/agg_result.rs +++ b/src/aggregation/agg_result.rs @@ -208,7 +208,8 @@ pub enum BucketEntries { } impl BucketEntries { - fn iter<'a>(&'a self) -> Box + 'a> { + /// Iterate over all bucket entries. + pub fn iter<'a>(&'a self) -> Box + 'a> { match self { BucketEntries::Vec(vec) => Box::new(vec.iter()), BucketEntries::HashMap(map) => Box::new(map.values()), diff --git a/src/aggregation/metric/mod.rs b/src/aggregation/metric/mod.rs index 517a2b9df..05ff861f2 100644 --- a/src/aggregation/metric/mod.rs +++ b/src/aggregation/metric/mod.rs @@ -107,10 +107,9 @@ pub enum PercentileValues { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] /// The entry when requesting percentiles with keyed: false pub struct PercentileValuesVecEntry { - /// Percentile + /// The percentile key (e.g. 1.0, 5.0, 25.0). pub key: f64, - - /// Value at the percentile + /// The percentile value. `NaN` when there are no values. pub value: f64, } diff --git a/src/collector/top_score_collector.rs b/src/collector/top_score_collector.rs index 0ce1c611a..057df4bcc 100644 --- a/src/collector/top_score_collector.rs +++ b/src/collector/top_score_collector.rs @@ -513,7 +513,9 @@ pub struct TopNComputer { /// The buffer reverses sort order to get top-semantics instead of bottom-semantics buffer: Vec>, top_n: usize, - pub(crate) threshold: Option, + /// The current threshold for pruning. Documents with scores at or below + /// this value are skipped by `push()`. Updated when the buffer is truncated. + pub threshold: Option, comparator: C, }