From a2ca12995ef4ccf8f223ba17a4245efc1da7b4de Mon Sep 17 00:00:00 2001 From: PSeitz Date: Thu, 19 Jan 2023 16:52:47 +0800 Subject: [PATCH] update aggregation docs (#1807) --- src/aggregation/metric/average.rs | 3 +-- src/aggregation/metric/count.rs | 3 +-- src/aggregation/metric/max.rs | 3 +-- src/aggregation/metric/min.rs | 3 +-- src/aggregation/metric/stats.rs | 3 +-- src/aggregation/metric/sum.rs | 3 +-- src/aggregation/mod.rs | 7 +++++-- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/aggregation/metric/average.rs b/src/aggregation/metric/average.rs index 2d16de9a8..ca8770a09 100644 --- a/src/aggregation/metric/average.rs +++ b/src/aggregation/metric/average.rs @@ -6,14 +6,13 @@ use super::{IntermediateStats, SegmentStatsCollector}; /// A single-value metric aggregation that computes the average of numeric values that are /// extracted from the aggregated documents. -/// Supported field types are u64, i64, and f64. /// See [super::SingleMetricResult] for return value. /// /// # JSON Format /// ```json /// { /// "avg": { -/// "field": "score", +/// "field": "score" /// } /// } /// ``` diff --git a/src/aggregation/metric/count.rs b/src/aggregation/metric/count.rs index 2a49c8dfe..b1674118f 100644 --- a/src/aggregation/metric/count.rs +++ b/src/aggregation/metric/count.rs @@ -6,14 +6,13 @@ use super::{IntermediateStats, SegmentStatsCollector}; /// A single-value metric aggregation that counts the number of values that are /// extracted from the aggregated documents. -/// Supported field types are u64, i64, and f64. /// See [super::SingleMetricResult] for return value. /// /// # JSON Format /// ```json /// { /// "value_count": { -/// "field": "score", +/// "field": "score" /// } /// } /// ``` diff --git a/src/aggregation/metric/max.rs b/src/aggregation/metric/max.rs index 842d183c9..bf579b653 100644 --- a/src/aggregation/metric/max.rs +++ b/src/aggregation/metric/max.rs @@ -6,14 +6,13 @@ use super::{IntermediateStats, SegmentStatsCollector}; /// A single-value metric aggregation that computes the maximum of numeric values that are /// extracted from the aggregated documents. -/// Supported field types are u64, i64, and f64. /// See [super::SingleMetricResult] for return value. /// /// # JSON Format /// ```json /// { /// "max": { -/// "field": "score", +/// "field": "score" /// } /// } /// ``` diff --git a/src/aggregation/metric/min.rs b/src/aggregation/metric/min.rs index 548423da0..395c214f2 100644 --- a/src/aggregation/metric/min.rs +++ b/src/aggregation/metric/min.rs @@ -6,14 +6,13 @@ use super::{IntermediateStats, SegmentStatsCollector}; /// A single-value metric aggregation that computes the minimum of numeric values that are /// extracted from the aggregated documents. -/// Supported field types are u64, i64, and f64. /// See [super::SingleMetricResult] for return value. /// /// # JSON Format /// ```json /// { /// "min": { -/// "field": "score", +/// "field": "score" /// } /// } /// ``` diff --git a/src/aggregation/metric/stats.rs b/src/aggregation/metric/stats.rs index 980958769..691921f25 100644 --- a/src/aggregation/metric/stats.rs +++ b/src/aggregation/metric/stats.rs @@ -7,14 +7,13 @@ use crate::{DocId, TantivyError}; /// A multi-value metric aggregation that computes a collection of statistics on numeric values that /// are extracted from the aggregated documents. -/// Supported field types are `u64`, `i64`, and `f64`. /// See [`Stats`] for returned statistics. /// /// # JSON Format /// ```json /// { /// "stats": { -/// "field": "score", +/// "field": "score" /// } /// } /// ``` diff --git a/src/aggregation/metric/sum.rs b/src/aggregation/metric/sum.rs index 204598bbc..91d58a2ec 100644 --- a/src/aggregation/metric/sum.rs +++ b/src/aggregation/metric/sum.rs @@ -6,14 +6,13 @@ use super::{IntermediateStats, SegmentStatsCollector}; /// A single-value metric aggregation that sums up numeric values that are /// extracted from the aggregated documents. -/// Supported field types are u64, i64, and f64. /// See [super::SingleMetricResult] for return value. /// /// # JSON Format /// ```json /// { /// "sum": { -/// "field": "score", +/// "field": "score" /// } /// } /// ``` diff --git a/src/aggregation/mod.rs b/src/aggregation/mod.rs index df1687161..c952a3bda 100644 --- a/src/aggregation/mod.rs +++ b/src/aggregation/mod.rs @@ -1,6 +1,5 @@ //! # Aggregations //! -//! //! An aggregation summarizes your data as statistics on buckets or metrics. //! //! Aggregations can provide answer to questions like: @@ -41,6 +40,10 @@ //! - [Metric](metric) //! - [Average](metric::AverageAggregation) //! - [Stats](metric::StatsAggregation) +//! - [Min](metric::MinAggregation) +//! - [Max](metric::MaxAggregation) +//! - [Sum](metric::SumAggregation) +//! - [Count](metric::CountAggregation) //! //! # Example //! Compute the average metric, by building [`agg_req::Aggregations`], which is built from an @@ -75,7 +78,7 @@ //! } //! ``` //! # Example JSON -//! Requests are compatible with the elasticsearch json request format. +//! Requests are compatible with the elasticsearch JSON request format. //! //! ``` //! use tantivy::aggregation::agg_req::Aggregations;