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

[BUG] case_insensitive wildcard query didn't return expected result #15855

Closed
HUSTERGS opened this issue Sep 9, 2024 · 1 comment · Fixed by #15882
Closed

[BUG] case_insensitive wildcard query didn't return expected result #15855

HUSTERGS opened this issue Sep 9, 2024 · 1 comment · Fixed by #15882
Labels
bug Something isn't working Search Search query, autocomplete ...etc

Comments

@HUSTERGS
Copy link
Contributor

HUSTERGS commented Sep 9, 2024

Describe the bug

When perform wildcard query on wildcard field with case_insensitive set to true, the expected doc didn't occur.

Related component

Search

To Reproduce

  1. Create a simple index contains wildcard field

    PUT case_test
    {
        "mappings": {
            "properties": {
                "wildcard": {
                    "type": "wildcard"
                }
            }
        }
    }
    
  2. Bulk insert documents contains capital letters

    PUT _bulk?refresh=true
    {"index": {"_index": "case_test"}}
    {"wildcard": "TtAa"}
    {"index": {"_index": "case_test"}}
    {"wildcard": "ttaa"}
    {"index": {"_index": "case_test"}}
    {"wildcard": "TTAA"}
    
  3. Search on wildcard field with case_insensitive set to true and false respectly
    case sensitive:

    POST case_test/_search
    {
        "query": {
            "term": {
                "wildcard": {
                    "value": "TtAa",
                    "case_insensitive": false
                }
            }
        }
    }
    

    case insensitive:

    POST case_test/_search
    {
        "query": {
            "term": {
                "wildcard": {
                    "value": "TtAa",
                    "case_insensitive": true
                }
            }
        }
    }
    
  4. Check result

Expected behavior

case insensitive query should return all three documents, instead of TtAa alone

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@HUSTERGS HUSTERGS added bug Something isn't working untriaged labels Sep 9, 2024
@github-actions github-actions bot added the Search Search query, autocomplete ...etc label Sep 9, 2024
@HUSTERGS HUSTERGS changed the title [BUG] case_insensitive wildcard query returns unexpected result [BUG] case_insensitive wildcard query didn't return expected result Sep 9, 2024
@HUSTERGS
Copy link
Contributor Author

bugfix is here #15882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Search Search query, autocomplete ...etc
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants