[BUG] Uppercase Regex in String queries search
See original GitHub issueRegex search on analyzed fields doesn’t work with capital letters now as if the analyzer saves them lower cased, or doesn’t use the standard analyzer for some reason.
To Reproduce Steps to reproduce the behavior:
- Create an index and add a doc containing uppercase letters to it (e.g
message: this is a TLS handshake
) - Perform this search request:
{"query": {"bool": {"must": [{"query_string": {"query": "message:/TLS/"}}]}}}
Expected behavior We should find the doc we added above since it’s an exact match. However, we got 0 results.
Plugins None
Host/Environment (please complete the following information): I used OpenSearch container with a single node (version 1.2.3), running on iOS 11.6.4
Additional context
If we specify the standard analyzer to the search request, we get the expected results.
{"query": {"bool": {"must": [{"query_string": {"query": "message:/TLS/", "analyzer":"standard"}}]}}}
Issue Analytics
- State:
- Created a year ago
- Comments:24 (12 by maintainers)
Top Results From Across the Web
How to check for uppercase letters in MySQL? - Stack Overflow
SELECT * FROM `users` WHERE `email` REGEXP BINARY '[A-Z]';. Using the above example, you'd get a list of emails that contain one or...
Read more >Regular expression syntax - Adobe Support
The regular expression [A-Z][a-z]* matches any sequence of letters that starts with an uppercase letter and is followed by zero or more ......
Read more >Case Insensitive Search with Regex - Atlas Triggers & Functions
I am trying to do a case-insensitive search using Regex - the documentation gives examples with literal strings but I am trying this...
Read more >Find upper case / lower case letters using Regex
Hi, I'm having trouble catching l/u case letters using regex expressions in Publisher. I try to use several syntaxes.
Read more >String functions | BigQuery - Google Cloud
Google Standard SQL for BigQuery supports string functions. ... In the following query, an error is thrown because the search value cannot be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@reta @nknize we believe that reverting the change (aligning the behavior with the way it worked before the fix) should be the way to go in this case because:
wildcard
, which OpenSearch doesn’t support. There is no real reason for this code to exist in the OpenSearch.please let me know what you think about it.
and we of course happy to contribute to it if that’s the way to go here.
@AmiStrn FYI
I am totally with you @AmiStrn @alexgnatyuk (https://github.com/opensearch-project/OpenSearch/issues/3578#issuecomment-1162136277), need @nknize confirmation this is away to go