-
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
Don't count lone wildcards as leading wildcards #17462
Conversation
const regex = value | ||
.split(wildcardSymbol) | ||
.map(escapeRegExp) | ||
.join('.*'); |
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.
Just reformatting via Prettier
return value | ||
.split(wildcardSymbol) | ||
.map(escapeQueryString) | ||
.join('*'); |
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.
Just reformatting via Prettier
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. How about a test though? 😉
Test added |
💔 Build Failed |
jenkins, test this |
💚 Build Succeeded |
The addition of the optional flag to disable leading wildcards inadvertently broke exists queries, which are accomplished in kuery with the fieldName:* syntax.
The addition of the optional flag to disable leading wildcards inadvertently broke exists queries, which are accomplished in kuery with the
fieldName:*
syntax. Example of the error:This PR just loosens the check in the hasLeadingWildcard helper.