-
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
[Query Parsing] Use unknownFilters as part of the search term #186432
Conversation
cf00805
to
fb1db31
Compare
/ci |
016eb51
to
66c5e8c
Compare
Pinging @elastic/appex-sharedux (Team:SharedUX) |
/ci |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
/ci |
const query = Query.parse('tag:tag-1 unknown:worlds some search'); | ||
|
||
expect(parseQuery(query, [])).toEqual({ | ||
queryText: 'some search unknown:worlds', |
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.
is it OK to invert the search?
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.
@afharo It looks like the order of terms doesn't matter
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.
FMI, do we support double-quote searches here?
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 the Saved Object Finder and in the Global Search Bar, term clauses containing a : were interpreted as field clause queries.
I would just have documented that :
is a special characters and that special characters must be escaped by double quoting the whole term. You're entering the rabit hole doing what you did there ihmo
I understand the concern that this issue didn't entirely seem like something we need to solve in code. From my point of view, it would be better to solve the issue with better UX rather than documenting a limitation, and I don't know if we have an appropriate place in our documentation that users would easily find or would fit this kind of message. Also, there didn't seem to be a big reason to treat Finally, I think that having a bad UX in a search bar is an especially bad thing for Elastic, since we are a search-based company, getting this right should be our forte. |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
History
|
Then maybe we could try to fix it upstream, especially given EUI is an internally maintained lib, instead of trying to "monkeypatch" that on top of the already existing syntax? It's just that in my experience, that kind of approach can become very painful in term of maintaince, so I wanted to share my concerns, but if we still think it's the best approach, I won't object or anything.
I absolutely agree |
This sounds good to me. I will place this PR in Draft mode for now. |
Closing for now, as the fix in the EUI repo will look very different than what was started here. |
Summary
Closes #184496
Issues fixed:
tag:foo
. The syntax was restricted to use an array, i.e:tag:(foo)
.:
were interpreted as field clause queries.It was noticed in this work that Global Search doesn't support the
must_not
match query. That is:-tag:foo
will search for content tagged withfoo
instead of excluding it. This problem isn't evident in the Saved Objects Finder. A fix for that will have to come in a separate PR.Release Note
Fixed an issue with the Global Search Bar where it was not possible to search for saved objects that contain a colon character.
Checklist