Skip to content

Commit 6444516

Browse files
committed
User serde default for the keyed params
1 parent a9b0d1a commit 6444516

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

src/aggregation/agg_req.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
//! "ranges": [
3838
//! { "from": 3.0, "to": 7.0 },
3939
//! { "from": 7.0, "to": 20.0 }
40-
//! ],
41-
//! "keyed": false
40+
//! ]
4241
//! }
4342
//! }
4443
//! }"#;

src/aggregation/bucket/histogram/histogram.rs

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ pub struct HistogramAggregation {
116116
/// bounds would not be returned.
117117
pub extended_bounds: Option<HistogramBounds>,
118118
/// Whether to return the buckets as a hash map
119+
#[serde(default)]
119120
pub keyed: bool,
120121
}
121122

src/aggregation/bucket/range.rs

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub struct RangeAggregation {
5757
/// range. Extra buckets will be created until the first to, and last from, if necessary.
5858
pub ranges: Vec<RangeAggregationRange>,
5959
/// Whether to return the buckets as a hash map
60+
#[serde(default)]
6061
pub keyed: bool,
6162
}
6263

src/aggregation/mod.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@
9393
//! { "from": 3.0, "to": 7.0 },
9494
//! { "from": 7.0, "to": 20.0 },
9595
//! { "from": 20.0 }
96-
//! ],
97-
//! "keyed": false
96+
//! ]
9897
//! },
9998
//! "aggs": {
10099
//! "average_in_range": { "avg": { "field": "score" } }
@@ -891,8 +890,7 @@ mod tests {
891890
{ "from": 7.0, "to": 19.0 },
892891
{ "from": 19.0, "to": 20.0 },
893892
{ "from": 20.0 }
894-
],
895-
"keyed": false
893+
]
896894
},
897895
"aggs": {
898896
"average_in_range": { "avg": { "field": "score" } },
@@ -908,8 +906,7 @@ mod tests {
908906
{ "from": 7.0, "to": 19.0 },
909907
{ "from": 19.0, "to": 20.0 },
910908
{ "from": 20.0 }
911-
],
912-
"keyed": false
909+
]
913910
},
914911
"aggs": {
915912
"average_in_range": { "avg": { "field": "score" } },
@@ -928,8 +925,7 @@ mod tests {
928925
{ "from": 7.0, "to": 19.0 },
929926
{ "from": 19.0, "to": 20.0 },
930927
{ "from": 20.0 }
931-
],
932-
"keyed": false
928+
]
933929
},
934930
"aggs": {
935931
"average_in_range": { "avg": { "field": "score" } },

0 commit comments

Comments
 (0)