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

Don't count lone wildcards as leading wildcards #17462

Merged
merged 2 commits into from
Mar 30, 2018

Conversation

Bargs
Copy link
Contributor

@Bargs Bargs commented Mar 29, 2018

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:

screen shot 2018-03-29 at 2 45 00 pm

This PR just loosens the check in the hasLeadingWildcard helper.

const regex = value
.split(wildcardSymbol)
.map(escapeRegExp)
.join('.*');
Copy link
Contributor Author

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('*');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reformatting via Prettier

Copy link
Member

@lukasolson lukasolson left a 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? 😉

@Bargs
Copy link
Contributor Author

Bargs commented Mar 29, 2018

Test added

@elasticmachine
Copy link
Contributor

💔 Build Failed

@Bargs
Copy link
Contributor Author

Bargs commented Mar 29, 2018

jenkins, test this

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@Bargs Bargs merged commit 9168f2e into elastic:master Mar 30, 2018
Bargs added a commit to Bargs/kibana that referenced this pull request Mar 30, 2018
The addition of the optional flag to disable leading wildcards inadvertently broke exists queries, which are accomplished in kuery with the fieldName:* syntax.
Bargs added a commit that referenced this pull request Mar 30, 2018
The addition of the optional flag to disable leading wildcards inadvertently broke exists queries, which are accomplished in kuery with the fieldName:* syntax.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants