Skip to content

Fix: visit of inner query for FunctionScoreQueryBuilder #16776

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 4 commits into from
Mar 13, 2025

Conversation

kodieg
Copy link
Contributor

@kodieg kodieg commented Dec 4, 2024

Description

This is version of #15404 cherrypicked on main.

Similar to #14739, but implements the visit method in FunctionScoreQueryBuilder to allow subqueries to be processed properly.

Related Issues

Resolves #15403
Similar to #15034

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.

Copy link
Contributor

github-actions bot commented Dec 4, 2024

✅ Gradle check result for 8339029: SUCCESS

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.33%. Comparing base (e306d51) to head (25d411e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...query/functionscore/FunctionScoreQueryBuilder.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16776      +/-   ##
============================================
+ Coverage     72.27%   72.33%   +0.05%     
- Complexity    65611    65674      +63     
============================================
  Files          5311     5311              
  Lines        304942   304946       +4     
  Branches      44225    44226       +1     
============================================
+ Hits         220407   220584     +177     
+ Misses        66448    66269     -179     
- Partials      18087    18093       +6     

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

Copy link
Contributor

github-actions bot commented Dec 6, 2024

❌ Gradle check result for 48eae48: 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 19c5597: SUCCESS

@gaobinlong gaobinlong added the backport 2.x Backport to 2.x branch label Dec 11, 2024
@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Jan 11, 2025
Copy link
Contributor

❕ Gradle check result for 25d411e: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.testSnapshotWithStuckNode

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

@gaobinlong gaobinlong merged commit 5a4c510 into opensearch-project:main Mar 13, 2025
33 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 13, 2025
* add visitor logic to FunctionScoreQueryBuilder

Signed-off-by: jdnvn <[email protected]>

* update changelog

Signed-off-by: jdnvn <[email protected]>

* add assertion that inner query builder was visited

Signed-off-by: Konrad Gołuchowski <[email protected]>

---------

Signed-off-by: jdnvn <[email protected]>
Signed-off-by: Konrad Gołuchowski <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Co-authored-by: jdnvn <[email protected]>
Co-authored-by: gaobinlong <[email protected]>
(cherry picked from commit 5a4c510)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dbwiddis pushed a commit that referenced this pull request Mar 13, 2025
)

* add visitor logic to FunctionScoreQueryBuilder



* update changelog



* add assertion that inner query builder was visited



---------






(cherry picked from commit 5a4c510)

Signed-off-by: jdnvn <[email protected]>
Signed-off-by: Konrad Gołuchowski <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: jdnvn <[email protected]>
Co-authored-by: gaobinlong <[email protected]>
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Mar 18, 2025
…roject#16776)

* add visitor logic to FunctionScoreQueryBuilder

Signed-off-by: jdnvn <[email protected]>

* update changelog

Signed-off-by: jdnvn <[email protected]>

* add assertion that inner query builder was visited

Signed-off-by: Konrad Gołuchowski <[email protected]>

---------

Signed-off-by: jdnvn <[email protected]>
Signed-off-by: Konrad Gołuchowski <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Co-authored-by: jdnvn <[email protected]>
Co-authored-by: gaobinlong <[email protected]>
Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch bug Something isn't working Search:Query Capabilities stalled Issues that have stalled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Cannot make use of default_model_id in function_score query type
2 participants