Skip to content

Conversation

sjs004
Copy link

@sjs004 sjs004 commented Sep 27, 2025

Description

CustomUnifiedHighlighter.rewriteCustomQuery() wasn't handling nested query (internally written as OpenSearchToParentBlockJoinQuery). Therefore unified highlighter wasn't working. Added the missing handling & updated tests

Related Issues

Resolves #19106

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.

@sjs004 sjs004 requested a review from a team as a code owner September 27, 2025 23:00
@sjs004 sjs004 changed the title Draft: 19106 - Fix for Unified highlighter with nested fields when match_phrase_prefix Draft: Fix for Unified highlighter with nested fields when match_phrase_prefix Sep 27, 2025
Copy link
Contributor

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

@sjs004 sjs004 force-pushed the fix-unified-highlighter-nested-fields branch from d61fbdb to bc6deeb Compare September 28, 2025 13:48
Copy link
Contributor

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

@sjs004 sjs004 changed the title Draft: Fix for Unified highlighter with nested fields when match_phrase_prefix Fix Unified highlighter for nested fields when using matchPhrasePrefixQuery Sep 30, 2025
@sjs004 sjs004 force-pushed the fix-unified-highlighter-nested-fields branch from 3f1e99c to 708767d Compare September 30, 2025 20:15
@sjs004 sjs004 force-pushed the fix-unified-highlighter-nested-fields branch from 708767d to 739a4b9 Compare September 30, 2025 20:19
Copy link
Contributor

❕ Gradle check result for 739a4b9: 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.

Copy link

codecov bot commented Sep 30, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.01%. Comparing base (83b2a6d) to head (739a4b9).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...ne/search/uhighlight/CustomUnifiedHighlighter.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19442      +/-   ##
============================================
+ Coverage     72.93%   73.01%   +0.07%     
- Complexity    70236    70288      +52     
============================================
  Files          5700     5700              
  Lines        322150   322152       +2     
  Branches      46616    46617       +1     
============================================
+ Hits         234966   235206     +240     
+ Misses        68225    67955     -270     
- Partials      18959    18991      +32     

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

@sjs004
Copy link
Author

sjs004 commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review. ✅ Project coverage is 73.01%. Comparing base (83b2a6d) to head (739a4b9). ⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...ne/search/uhighlight/CustomUnifiedHighlighter.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

@@             Coverage Diff              @@
##               main   #19442      +/-   ##
============================================
+ Coverage     72.93%   73.01%   +0.07%     
- Complexity    70236    70288      +52     
============================================
  Files          5700     5700              
  Lines        322150   322152       +2     
  Branches      46616    46617       +1     
============================================
+ Hits         234966   235206     +240     
+ Misses        68225    67955     -270     
- Partials      18959    18991      +32     

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

🚀 New features to boost your workflow:

org.opensearch.search.fetch.subphase.highlight.HighlighterSearchIT.testWithNestedQuery, this test fails if I remove the newly added block & I have debugged also that branch is being covered. Not sure why test report is suggesting that newly added code is not covered. One reason could be that this particular test suite may not be part of coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Unified highlighter does not highlight nested fields when match_phrase_prefix is used
1 participant