Skip to content
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

Edit Query DSL not considering the "is not" operator, and wildcards not working #49730

Open
timroes opened this issue Oct 30, 2019 · 9 comments
Labels
enhancement New value added to drive a business result Feature:Filters Feature:Search Querying infrastructure in Kibana impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)

Comments

@timroes
Copy link
Contributor

timroes commented Oct 30, 2019

Currently the filter Query DSL, does not match when you use the is not operator. When you use it and click on Edit Query DSL link, it shows a simple match query, without the not being applied, however it works as expected since the not is applied behind the scenes, a query like this is passed:

"must_not": [{
  "match_phrase": {
    "remoteAddress": {
      "query": "your_query"
    }
  }
}]

This is quite confusing for users since they don´t see the is not being applied in the written query (Edit Query DSL link).

Also, the problem with the above query is that it does not take into account wildcards. In order to do that you should edit and write your Query properly for every filter. Something like this:

{
  "query": {
    "bool": {
      "must_not": {
        "wildcard": {
          "remoteAddress": {
            "value": "*example.com"
          }
        }
      }
    }
  }
}
@timroes timroes added Feature:Filters enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Oct 30, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@timroes
Copy link
Contributor Author

timroes commented Oct 30, 2019

cc @Bargs

@Bargs
Copy link
Contributor

Bargs commented Oct 30, 2019

Wildcards are not supposed to work at the moment, we have an open issue for that #13943. Rather than support wildcards in is and is not I think we should add a new contains operator. That's the approach this community PR was going with, but it has lost traction (my fault).

This is quite confusing for users since they don´t see the is not being applied in the written query

Has this come up for you a lot in discussions with users? I've never heard of anyone complaining about it before. I think it's better to think of negation as a flag on the filter rather than a part of the filter's query. If we were to include the must_not on negated filters, then it would only make sense to include the filter on non-negated filters. Then that would lead to users trying to change the filter to a must for scoring. And we have a lot of logic that relies on the query having a particular shape in order to determine what kind of filter is being dealt with, so all of that would need to be updated to account for the possible top level must_not. It's a whole can of worms 🐛🐛🐛 :)

@mikeh688
Copy link

Hi,
I raised this issue with Elastic support (we're an Elastic OEM partner). One of our customers experienced the issue and the scenario is one that will occur frequently (find all records that do not contain string xxx). 'Contains' would work as an alternative. From a userability perspective, the contains filter should also be available in the 'add a filter' option list (as well as does not contain).

I think the issue is that searching for wildcards and NOT doesn’t work. That took us down the path of having to use the JSON queries.

The ticket reads as a feature request rather than a very basic bug that needs fixing; a tool that’s positioned as being powerful at searching and processing data is pretty compromised if it cant do basic wildcard searches and include NOTs

@timroes timroes added Team:AppArch and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Mar 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@kibanamachine kibanamachine added this to To triage in kibana-app-arch Mar 16, 2020
@keitalbame
Copy link

I noticed the NOT operator is not reflected in the DSL when creating the filter from the UI on Kibana 7.6.2.
Did not tested on a recent version.

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Jun 2, 2021
@exalate-issue-sync exalate-issue-sync bot removed the loe:small Small Level of Effort label May 12, 2022
@vadimkibana
Copy link
Contributor

Thank you for contributing to this issue, however, we are closing this issue due to inactivity as part of a backlog grooming effort. If you believe this feature/bug should still be considered, please reopen with a comment.

@vadimkibana vadimkibana closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2022
kibana-app-arch automation moved this from To triage to Done in current release Aug 10, 2022
@lukasolson
Copy link
Member

Reopening this one, since it is especially relevant to the complex and/or filtering effort.

@lukasolson lukasolson reopened this Oct 26, 2022
kibana-app-arch automation moved this from Done in current release to In progress Oct 26, 2022
@petrklapka petrklapka added Feature:Search Querying infrastructure in Kibana Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) and removed Team:AppServicesSv labels Nov 23, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kibanamachine kibanamachine added this to Inbox in Discover Nov 23, 2022
@davismcphee davismcphee added the loe:needs-research This issue requires some research before it can be worked on or estimated label Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Filters Feature:Search Querying infrastructure in Kibana impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)
Projects
kibana-app-arch
  
In progress
Development

No branches or pull requests

9 participants