Skip to content

[BUG] SQL wildcard characters not converted to Lucene wildcards in WildcardQuerySerializer #21738

@nssuresh2007

Description

@nssuresh2007

Describe the bug

The WildcardQuerySerializer was passing SQL wildcard patterns directly to Lucene's WildcardQueryBuilder without conversion. SQL uses % (match any sequence) and _ (match single character), but Lucene expects * and ? respectively. This caused the following integration tests to fail in WildCardQueryIT:

  • test_escaping_wildcard_percent_in_text
  • test_wildcard_query_sql_wildcard_underscore_conversion
  • test_wildcard_query_sql_wildcard_percent_conversion

Related component

No response

To Reproduce

Run the WildCardQueryIT, specifically the following tests:

  • test_escaping_wildcard_percent_in_text
  • test_wildcard_query_sql_wildcard_underscore_conversion
  • test_wildcard_query_sql_wildcard_percent_conversion

Expected behavior

Test should pass correctly where they query gets converted into Lucene format as expected

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions