Commit 6d8545da by Ivana Huckova Committed by GitHub

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
parent d28d4952
...@@ -135,8 +135,8 @@ export class ElasticResponse { ...@@ -135,8 +135,8 @@ export class ElasticResponse {
table.addColumn({ text: metricName }); table.addColumn({ text: metricName });
values.push(value); values.push(value);
}; };
const buckets = _.isArray(esAgg.buckets) ? esAgg.buckets : [esAgg.buckets];
for (const bucket of esAgg.buckets) { for (const bucket of buckets) {
const values = []; const values = [];
for (const propValues of _.values(props)) { for (const propValues of _.values(props)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment