From ea372f042788f61a53ebbca3486090cc8577a20a Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 17 Dec 2020 12:13:02 -0800 Subject: add support for 'filters' aggregation --- src/parse.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/parse.rs b/src/parse.rs index 8656daa..07c55a0 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -239,6 +239,14 @@ pub enum ApiQueryOrArray { Array(Vec), } +#[derive(Serialize, Deserialize, Debug)] +#[serde(deny_unknown_fields)] +#[serde(untagged)] +pub enum ApiQueryNamedOrArray { + Named(HashMap), + Array(Vec), +} + #[derive(Serialize, Deserialize, Debug)] #[serde(deny_unknown_fields)] pub struct ApiHighlight { @@ -644,6 +652,8 @@ pub struct ApiAggregation { #[serde(skip_serializing_if = "Option::is_none")] filter: Option, #[serde(skip_serializing_if = "Option::is_none")] + filters: Option, + #[serde(skip_serializing_if = "Option::is_none")] histogram: Option, #[serde(skip_serializing_if = "Option::is_none")] terms: Option, @@ -713,6 +723,14 @@ pub struct DateHistogramAggregation { missing: Option, } +#[derive(Serialize, Deserialize, Debug)] +#[serde(deny_unknown_fields)] +pub struct FiltersAggregation { + #[serde(skip_serializing_if = "Option::is_none")] + other_bucket_key: Option, + filters: ApiQueryNamedOrArray, +} + #[derive(Serialize, Deserialize, Debug)] #[serde(deny_unknown_fields)] pub struct TermsAggregation { -- cgit v1.2.3