Skip to content

Conversation

@Deven009
Copy link

Description

The getNonWildcardSequence method incorrectly handled cases where an escaped backslash was followed by a wildcard character. It would check if the character before a wildcard was a backslash, but didn't account for that backslash itself being escaped.

For example, the query "some\" (matching strings containing "some") would incorrectly return "some\*" instead of "some\", causing invalid ngrams containing the wildcard character to be generated.

The fix counts consecutive backslashes before wildcards:

  • Even count: wildcard is NOT escaped
  • Odd count: wildcard IS escaped

Related Issues

Resolves #19719

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions
Copy link
Contributor

❌ Gradle check result for bd3dcf8: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

…earch-project#19719)

The getNonWildcardSequence method incorrectly handled cases where an
escaped backslash was followed by a wildcard character. It would check
if the character before a wildcard was a backslash, but didn't account
for that backslash itself being escaped.

For example, the query "*some\\*" (matching strings containing "some\")
would incorrectly return "some\\*" instead of "some\\", causing invalid
ngrams containing the wildcard character to be generated.

The fix counts consecutive backslashes before wildcards:
- Even count: wildcard is NOT escaped
- Odd count: wildcard IS escaped

Signed-off-by: Deven Prajapati <[email protected]>
Signed-off-by: Deven009 <[email protected]>
@Deven009 Deven009 force-pushed the deven009/fix/wildcard-escaped-backslash-19719 branch from bd3dcf8 to 95fe858 Compare October 30, 2025 03:51
@github-actions
Copy link
Contributor

❌ Gradle check result for 95fe858: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

❕ Gradle check result for d2a4ad5: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.19%. Comparing base (a036313) to head (d2a4ad5).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19756      +/-   ##
============================================
+ Coverage     73.15%   73.19%   +0.04%     
- Complexity    71118    71168      +50     
============================================
  Files          5754     5754              
  Lines        325298   325304       +6     
  Branches      47052    47054       +2     
============================================
+ Hits         237975   238111     +136     
+ Misses        68154    68052     -102     
+ Partials      19169    19141      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working good first issue Good for newcomers Search:Query Capabilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Wildcard Query: Escaped Backslash before operator

1 participant