From 7f97490b777060afd828c30253a270f77af1e4ba Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 27 Apr 2023 08:20:48 -0600 Subject: [PATCH] Sergi fix 1 Co-authored-by: Sergi Massaneda --- .../src/containers/query/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/kbn-securitysolution-grouping/src/containers/query/index.ts b/packages/kbn-securitysolution-grouping/src/containers/query/index.ts index 6c5e45225ce4e..b00a46a33fefd 100644 --- a/packages/kbn-securitysolution-grouping/src/containers/query/index.ts +++ b/packages/kbn-securitysolution-grouping/src/containers/query/index.ts @@ -116,7 +116,9 @@ export const parseGroupingQuery = ( buckets: Array> ): Array & GroupingBucket> => buckets.map((group) => { - const groupKeyArray = Array.isArray(group.key) ? group.key : [group.key]; + if (!Array.isArray(group.key)) { + return group; + } // If the keys are different means that the `missing` values of the multi_terms aggregation have been applied, we use the default empty string. // If the keys are equal means the `missing` values have not been applied, they are stored values. return groupKeyArray[0] === groupKeyArray[1]