-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Kibana creates bogus filters on fields with null values. #7189
Comments
Happening in 5.x too, see #8164. |
Should filtering on a null value create a filter that matches docs where the field exists, or does not exist? To me it seems like it should be the latter. |
We discussed this on Zoom today. Since There are some additional scenarios where the +/- buttons should be disabled:
Elasticsearch also has a feature for making null values searchable. null_value allows users to specify a single value to index in place of |
I just hit this today as well. I think the UX now is even worse than the one reported above. Above was reported that there is an error with Kibana version: Elasticsearch version: Describe the bug: Steps to reproduce:
Expected behavior: Screenshots (if relevant): Errors in browser console (if relevant):
Any additional context: The filter (in Query DSL) looks like this:
|
Going back to at least 7.3, an error is now displayed if you try to create a filter on a null value. This is better than creating bogus filters, but the solution outlined in #7189 (comment) would still be the proper fix. |
Pinging @elastic/kibana-app-arch (Team:AppArch) |
Any plan to fix it in the coming releases? |
…#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 <olson.lukas@gmail.com> * 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 <olson.lukas@gmail.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * improve test stability Co-authored-by: Lukas Olson <olson.lukas@gmail.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Some background:
This example uses a custom mapping, but I do not believe it is involved. Possibly more relevant is our use of the logstash csv filter, which generates null values for missing columns by default.
Consider a _source document that contains a null value for a not-analyzed field.
Kibana will present the value for this field as " - ", and also provides the typical +/- filter buttons. When selecting one of these buttons, the search immediately becomes invalid, and the following error banner is displayed:
The underlying problem appears to be with the filter syntax. Clicking the edit button on the filter UI element shows the following:
It would seem simple enough for Kibana to 1) recognize this as a null value, and 2) create the query in the the appropriate filter context as follows:
Note that manually editing the filter to use this syntax works as expected.
The text was updated successfully, but these errors were encountered: