Skip to content

[Bug Fix] Fix the backward compatibility regression with COMPLEMENT for Regexp queries introduced in OpenSearch 3.0 #18640

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

Merged
merged 2 commits into from
Jul 1, 2025

Conversation

prudhvigodithi
Copy link
Member

@prudhvigodithi prudhvigodithi commented Jun 29, 2025

Description

Coming from @msfroh suggestion #18397 (comment) I can see the issue where the COMPLEMENT is dropped and sanitisedSyntaxFlag returns as 0. With this change I see the value as 65536 (0x10000) which works as expected.

Added an IT test as I assume we cannot test this with existing unit tests in RegexpQueryBuilderTests.

Background, the COMPLEMENT(RegExp.DEPRECATED_COMPLEMENT), is updated as part of #16366

Note

When we upgrade to Lucene 11 (OpenSearch 4.0), we should:

CC: @getsaurabh02

Related Issues

#18397

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.

Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
@prudhvigodithi prudhvigodithi self-assigned this Jun 29, 2025
@prudhvigodithi prudhvigodithi changed the title [Bug Fix] Honor COMPLEMENT for Regexp queries [Bug Fix] Honor COMPLEMENT for Regexp queries Jun 29, 2025
Copy link
Contributor

✅ Gradle check result for cef249f: SUCCESS

Copy link

codecov bot commented Jun 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.72%. Comparing base (0874e58) to head (b445a49).
Report is 9 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18640      +/-   ##
============================================
- Coverage     72.80%   72.72%   -0.09%     
+ Complexity    68437    68363      -74     
============================================
  Files          5563     5563              
  Lines        314174   314177       +3     
  Branches      45554    45555       +1     
============================================
- Hits         228726   228474     -252     
- Misses        66871    67166     +295     
+ Partials      18577    18537      -40     

☔ 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.

@prudhvigodithi prudhvigodithi requested review from msfroh and cwperks June 30, 2025 01:46
Copy link
Contributor

❌ Gradle check result for c1a60ba: 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?

Copy link
Contributor

❌ Gradle check result for e1ea812: 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?

@prudhvigodithi prudhvigodithi force-pushed the workflow-bug branch 2 times, most recently from e2e52bb to fb4f5d6 Compare June 30, 2025 22:49
Copy link
Contributor

❌ Gradle check result for fb4f5d6: 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?

Copy link
Contributor

github-actions bot commented Jul 1, 2025

❌ Gradle check result for e0b74e4:

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?

Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
@prudhvigodithi prudhvigodithi changed the title [Bug Fix] Honor COMPLEMENT for Regexp queries [Bug Fix] Fix the backward compatibility regression with COMPLEMENT for Regexp queries introduced in OpenSearch 3.0 Jul 1, 2025
Copy link
Contributor

github-actions bot commented Jul 1, 2025

✅ Gradle check result for b445a49: SUCCESS

@cwperks cwperks merged commit 1af55d2 into opensearch-project:main Jul 1, 2025
32 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 1, 2025
… for Regexp queries introduced in OpenSearch 3.0 (#18640)

* FIx ~ bug

Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>

* Update changelog

Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>

---------

Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
(cherry picked from commit 1af55d2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants