-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] Escaped wildcard character in wildcard query not handled correctly #15555
Comments
That sounds like bug! In particular, the methods Also, I suspect that the logic in OpenSearch/server/src/main/java/org/opensearch/index/mapper/WildcardFieldMapper.java Lines 433 to 450 in b71e547
Regex.simpleMatch might not handle escapes properly either. Maybe we just go with the WildcardQuery.toAutomaton approach always, since it does handle escapes properly.
@HUSTERGS, are you willing to fix those methods? If not, I can take care of it (but probably not in time for the 2.17 release, which we expect to freeze today/tomorrow). |
OF COURSE! @msfroh OpenSearch/server/src/main/java/org/opensearch/index/mapper/WildcardFieldMapper.java Line 479 in 1935650
So I add a simple shortcut at the beginning of |
Describe the bug
When use wildcard query on wildcard field, raw
*
(and maybe include raw?
), is not handled correctly, while the same wildcard query can work well on keyword field. Possibly the escape logic is not implemented inopensearch/index/mapper/WildcardFieldMapper.java
.Related component
Search
To Reproduce
*
Search on KEYWORD type:
Expected behavior
get the correct results when wildcard query contains raw
*
and?
charactersAdditional Details
No response
The text was updated successfully, but these errors were encountered: