summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-12-17 12:13:02 -0800
committerBryan Newbold <bnewbold@archive.org>2020-12-17 12:13:02 -0800
commitea372f042788f61a53ebbca3486090cc8577a20a (patch)
treee143999bda29ada7eb045798183f763dccc9887b /src
parent26dd0d0ad8cc9ce29a3db6dd35b800654ff393ae (diff)
downloades-public-proxy-ea372f042788f61a53ebbca3486090cc8577a20a.tar.gz
es-public-proxy-ea372f042788f61a53ebbca3486090cc8577a20a.zip
add support for 'filters' aggregation
Diffstat (limited to 'src')
-rw-r--r--src/parse.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/parse.rs b/src/parse.rs
index 8656daa..07c55a0 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -241,6 +241,14 @@ pub enum ApiQueryOrArray {
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
+#[serde(untagged)]
+pub enum ApiQueryNamedOrArray {
+ Named(HashMap<String, ApiQuery>),
+ Array(Vec<ApiQuery>),
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+#[serde(deny_unknown_fields)]
pub struct ApiHighlight {
// TODO: fields could also be an array of strings?
fields: HashMap<String, HighlightField>,
@@ -644,6 +652,8 @@ pub struct ApiAggregation {
#[serde(skip_serializing_if = "Option::is_none")]
filter: Option<ApiQuery>,
#[serde(skip_serializing_if = "Option::is_none")]
+ filters: Option<FiltersAggregation>,
+ #[serde(skip_serializing_if = "Option::is_none")]
histogram: Option<SimpleAggregation>,
#[serde(skip_serializing_if = "Option::is_none")]
terms: Option<TermsAggregation>,
@@ -715,6 +725,14 @@ pub struct DateHistogramAggregation {
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
+pub struct FiltersAggregation {
+ #[serde(skip_serializing_if = "Option::is_none")]
+ other_bucket_key: Option<String>,
+ filters: ApiQueryNamedOrArray,
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+#[serde(deny_unknown_fields)]
pub struct TermsAggregation {
field: String,
#[serde(skip_serializing_if = "Option::is_none")]