Skip to content

[BUG] case_insensitive regexp query didn't return expected result on a wildcard field #16755

Open
@n9

Description

@n9

Describe the bug

Case insensitive regexp query on a wildcard field does not work.

Related component

Search

To Reproduce

Based on #15855

  1. Create a simple index contains a wildcard field
    PUT case_test
    {
        "mappings": {
            "properties": {
                "wildcard": {
                    "type": "wildcard"
                }
            }
        }
    }
    
  1. Bulk insert documents containing capital letters
    PUT _bulk?refresh=true
    {"index": {"_index": "case_test"}}
    {"wildcard": "TtAa"}
    {"index": {"_index": "case_test"}}
    {"wildcard": "ttaa"}
    {"index": {"_index": "case_test"}}
    {"wildcard": "TTAA"}
    
  1. Perform regexp search on the wildcard field with case_insensitive set to true.

    POST case_test/_search
    {
        "query": {
            "regexp": {
                "wildcard": {
                    "value": "TtAa",
                    "case_insensitive": true
                }
            }
        }
    }
    
  2. Check results

Expected behavior

All documents should be returned, but not.

Additional Details

Host/Environment (please complete the following information):

  • Version 2.18.0

Metadata

Metadata

Assignees

Labels

SearchSearch query, autocomplete ...etcbugSomething isn't working

Type

No type

Projects

Status

🆕 New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions