-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow creating filters from fields with null values in discover #70936
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In playing around with this PR, I noticed that we aren't properly handling the case where the value is an array of multiple null
values:
I also noticed that for missing fields, we don't show the add inclusive/exclusive filter buttons. We should probably make the behavior the same (show the filter buttons for adding exists/not exists filters).
src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts
Outdated
Show resolved
Hide resolved
src/plugins/data/public/query/filter_manager/lib/generate_filters.ts
Outdated
Show resolved
Hide resolved
…ers.ts Co-authored-by: Lukas Olson <[email protected]>
@elasticmachine merge upstream |
Allow filtering by a non existing field in the doc simplify flatten hit logic
@lukasolson resolved both issue you had suggested 🙇♀️ |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Owner code LGTM 👍 , tested locally in Chrome, Firefox, Safari, MacOS 10.14.6. That a Filter For
action for null/undefined value creates a "NOT exists" made me dizzy 💫 at the start, but it makes sense.
…tic#70936) * Fix bug elastic#7189 * typo * Test adjustments * wait for load complete * Fine tune test * Update src/plugins/data/public/query/filter_manager/lib/generate_filters.ts Co-authored-by: Lukas Olson <[email protected]> * Fix filtering by an array of nulls Allow filtering by a non existing field in the doc simplify flatten hit logic Co-authored-by: Lukas Olson <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
…#70936) (#71211) * Allow creating filters from fields with null values in discover (#70936) * Fix bug #7189 * typo * Test adjustments * wait for load complete * Fine tune test * Update src/plugins/data/public/query/filter_manager/lib/generate_filters.ts Co-authored-by: Lukas Olson <[email protected]> * Fix filtering by an array of nulls Allow filtering by a non existing field in the doc simplify flatten hit logic Co-authored-by: Lukas Olson <[email protected]> Co-authored-by: Elastic Machine <[email protected]> * improve test stability Co-authored-by: Lukas Olson <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Summary
In discover, allow creating filters from fields with null \ undefined values.
The created filter is a exists filter.
This fix also includes fixing an issue with
flattenHits
where empty array values are inserted into the field incorrectly.Functional test added as well.
Dev docs
Bug fix for #7189: Allow creating filters from fields with null \ undefined values.
Checklist
Delete any items that are not applicable to this PR.
For maintainers