mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Stop sending null in ip range from/to props
The IP range agg supports open ended ranges. Elasticsearch 2.x was lenient and accepted null as a value for the from/to props, but the correct way to do an open ended range was always to omit the from/to key entirely. ES 5.0 appears to be more strict and barfs when null is passed. This commit removes the null values. Fixes https://github.com/elastic/kibana/issues/8741
This commit is contained in:
parent
f344a4b262
commit
3ca45ba546
1 changed files with 10 additions and 2 deletions
|
@ -45,8 +45,16 @@ export default function RangeAggDefinition(Private) {
|
|||
},
|
||||
editor: ipRangesTemplate,
|
||||
write: function (aggConfig, output) {
|
||||
let ipRangeType = aggConfig.params.ipRangeType;
|
||||
output.params.ranges = aggConfig.params.ranges[ipRangeType];
|
||||
const ipRangeType = aggConfig.params.ipRangeType;
|
||||
let ranges = aggConfig.params.ranges[ipRangeType];
|
||||
|
||||
if (ipRangeType === 'fromTo') {
|
||||
ranges = _.map(ranges, (range) => {
|
||||
return _.omit(range, _.isNull);
|
||||
});
|
||||
}
|
||||
|
||||
output.params.ranges = ranges;
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue