From 399d39e60e8c582a348180de85c7911f43b6bde9 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 2 Dec 2022 15:11:45 -0500 Subject: [PATCH] [8.6] [Lens] fix lucene object query bug (#146846) (#146914) # Backport This will backport the following commits from `main` to `8.6`: - [[Lens] fix lucene object query bug (#146846)](https://github.com/elastic/kibana/pull/146846) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Andrew Tate --- x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts b/x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts index 6597046c9a275..c6377fb76d03c 100644 --- a/x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts +++ b/x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts @@ -176,7 +176,9 @@ export function combineQueryAndFilters( }; const allQueries = Array.isArray(query) ? query : query && isOfQueryType(query) ? [query] : []; - const nonEmptyQueries = allQueries.filter((q) => Boolean(q.query.trim())); + const nonEmptyQueries = allQueries.filter((q) => + Boolean(typeof q.query === 'string' ? q.query.trim() : q.query) + ); [queries.lucene, queries.kuery] = partition(nonEmptyQueries, (q) => q.language === 'lucene');