Elastic: Fix error "e.buckets[Symbol.iterator] is not a function" when using filter (#26217)

* Add bucket to array if it is not in array

* Fix issue one level above

* Rename variable

* Move array check to processAggregationDocs
This commit is contained in:
Ivana Huckova 2020-07-10 17:04:05 +02:00 committed by GitHub
parent d28d495235
commit 6d8545da63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,8 +135,8 @@ export class ElasticResponse {
table.addColumn({ text: metricName });
values.push(value);
};
for (const bucket of esAgg.buckets) {
const buckets = _.isArray(esAgg.buckets) ? esAgg.buckets : [esAgg.buckets];
for (const bucket of buckets) {
const values = [];
for (const propValues of _.values(props)) {