From 8a4376fb2a3404ffaf58b6946f1086bdc793aea5 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 17 Dec 2020 13:08:39 -0800 Subject: add support for date_histogram and composite aggregations --- src/parse.rs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/parse.rs b/src/parse.rs index 07c55a0..10216f7 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -141,6 +141,8 @@ pub struct SearchBody { pub terminate_after: Option, #[serde(skip_serializing_if = "Option::is_none")] pub timeout: Option, // string is "time units" + #[serde(skip_serializing_if = "Option::is_none")] + pub track_total_hits: Option, } #[derive(Serialize, Deserialize, Debug)] @@ -654,8 +656,12 @@ pub struct ApiAggregation { #[serde(skip_serializing_if = "Option::is_none")] filters: Option, #[serde(skip_serializing_if = "Option::is_none")] + composite: Option, + #[serde(skip_serializing_if = "Option::is_none")] histogram: Option, #[serde(skip_serializing_if = "Option::is_none")] + date_histogram: Option, + #[serde(skip_serializing_if = "Option::is_none")] terms: Option, #[serde(skip_serializing_if = "Option::is_none")] significant_terms: Option, @@ -698,6 +704,8 @@ pub struct SimpleAggregation { #[serde(skip_serializing_if = "Option::is_none")] missing: Option, #[serde(skip_serializing_if = "Option::is_none")] + missing_bucket: Option, + #[serde(skip_serializing_if = "Option::is_none")] keyed: Option, } @@ -716,11 +724,23 @@ pub struct DateHistogramAggregation { #[serde(skip_serializing_if = "Option::is_none")] offset: Option, #[serde(skip_serializing_if = "Option::is_none")] - order: Option>, + order: Option, #[serde(skip_serializing_if = "Option::is_none")] keyed: Option, #[serde(skip_serializing_if = "Option::is_none")] missing: Option, + #[serde(skip_serializing_if = "Option::is_none")] + missing_bucket: Option, +} + +#[derive(Serialize, Deserialize, Debug)] +#[serde(deny_unknown_fields)] +pub struct CompositeAggregation { + sources: Vec>, + #[serde(skip_serializing_if = "Option::is_none")] + size: Option, + #[serde(skip_serializing_if = "Option::is_none")] + after: Option>, } #[derive(Serialize, Deserialize, Debug)] @@ -744,7 +764,7 @@ pub struct TermsAggregation { #[serde(skip_serializing_if = "Option::is_none")] show_term_doc_count_error: Option, #[serde(skip_serializing_if = "Option::is_none")] - order: Option>, + order: Option, #[serde(skip_serializing_if = "Option::is_none")] include: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -753,4 +773,6 @@ pub struct TermsAggregation { execution_hint: Option, #[serde(skip_serializing_if = "Option::is_none")] missing: Option, + #[serde(skip_serializing_if = "Option::is_none")] + missing_bucket: Option, } -- cgit v1.2.3