pub struct Aggregation {
pub name: String,
pub agg_type: AggregationType,
pub field: String,
pub size: usize,
pub ranges: Vec<AggRange>,
pub interval: Option<f64>,
}Expand description
聚合定义
Fields§
§name: String聚合名称
agg_type: AggregationType聚合类型
field: String聚合字段
size: usize返回桶数量(仅 Terms/Histogram)
ranges: Vec<AggRange>范围定义(仅 Range 聚合)
interval: Option<f64>直方图间隔(仅 Histogram)
Implementations§
Source§impl Aggregation
impl Aggregation
pub fn terms(name: impl Into<String>, field: impl Into<String>) -> Self
pub fn range(name: impl Into<String>, field: impl Into<String>) -> Self
pub fn sum(name: impl Into<String>, field: impl Into<String>) -> Self
pub fn avg(name: impl Into<String>, field: impl Into<String>) -> Self
pub fn max(name: impl Into<String>, field: impl Into<String>) -> Self
pub fn min(name: impl Into<String>, field: impl Into<String>) -> Self
pub fn histogram( name: impl Into<String>, field: impl Into<String>, interval: f64, ) -> Self
pub fn count(name: impl Into<String>, field: impl Into<String>) -> Self
pub fn with_size(self, size: usize) -> Self
pub fn with_range(self, from: Option<f64>, to: Option<f64>) -> Self
Trait Implementations§
Source§impl Clone for Aggregation
impl Clone for Aggregation
Source§fn clone(&self) -> Aggregation
fn clone(&self) -> Aggregation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Aggregation
impl Debug for Aggregation
Source§impl<'de> Deserialize<'de> for Aggregation
impl<'de> Deserialize<'de> for Aggregation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Aggregation
impl RefUnwindSafe for Aggregation
impl Send for Aggregation
impl Sync for Aggregation
impl Unpin for Aggregation
impl UnsafeUnpin for Aggregation
impl UnwindSafe for Aggregation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more