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
[RAM] Allow wildcard search on rule's name and tags #136312
[RAM] Allow wildcard search on rule's name and tags #136312
Conversation
…ldcard-search-rules
…ldcard-search-rules
…ldcard-search-rules
…rM/kibana into 131230-allow-wildcard-search-rules
Pinging @elastic/response-ops (Team:ResponseOps) |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
let optionsFilter: KueryNode | string | null = filter ?? null; | ||
try { | ||
if (optionsFilter != null && typeof optionsFilter === 'string') { | ||
// FUTURE ENGINEER -> if I can parse it that mean it is a KueryNode or it is a string |
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.
instead of the comment you could create a function with a descriptive name like isKueryNodeOrString
, up to you
optionsFilter = JSON.parse(optionsFilter); | ||
} | ||
} catch (e) { | ||
optionsFilter = filter ?? null; |
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.
at this point optionsFilter has already the same value so you might consider removing this line or the assignation in line 11
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.
awesome work! I pulled the PR and it tests great.
Summary
Resolve #131230
This PR will allow our user to use wildcard to find rule's name and tag without crashing the application. if we want to find rule with just few letter and without using wildcard, we will have to implement N-gram tokenizer on the saved object to allow this kind of search.
Checklist