mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-06-03 09:00:42 +00:00
update aggregation docs (#1807)
This commit is contained in:
@@ -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"
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@@ -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"
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@@ -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"
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@@ -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"
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@@ -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"
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@@ -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"
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user