Skip to content

Commit

Permalink
[8.6] [Lens] fix lucene object query bug (elastic#146846) (elastic#14…
Browse files Browse the repository at this point in the history
…6914)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Lens] fix lucene object query bug
(elastic#146846)](elastic#146846)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Andrew
Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-12-02T19:05:53Z","message":"[Lens]
fix lucene object query bug (elastic#146846)\n\n## Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/146819","sha":"3c351fffc184d23eafd98a0c61d6c3e28840a59d","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:prev-minor","v8.7.0"],"number":146846,"url":"https://github.com/elastic/kibana/pull/146846","mergeCommit":{"message":"[Lens]
fix lucene object query bug (elastic#146846)\n\n## Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/146819","sha":"3c351fffc184d23eafd98a0c61d6c3e28840a59d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146846","number":146846,"mergeCommit":{"message":"[Lens]
fix lucene object query bug (elastic#146846)\n\n## Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/146819","sha":"3c351fffc184d23eafd98a0c61d6c3e28840a59d"}}]}]
BACKPORT-->

Co-authored-by: Andrew Tate <[email protected]>
  • Loading branch information
kibanamachine and drewdaemon authored Dec 2, 2022
1 parent a924f45 commit 399d39e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 399d39e

Please sign in to comment.