Skip to content
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

Fix: visit of inner query for FunctionScoreQueryBuilder #15404

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jdnvn
Copy link

@jdnvn jdnvn commented Aug 25, 2024

Description

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

✅ Gradle check result for 7bac688: SUCCESS

Copy link
Contributor

❕ Gradle check result for d8e8390: 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 Aug 25, 2024

Codecov Report

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

Project coverage is 71.92%. Comparing base (6152afe) to head (3258eea).
Report is 16 commits behind head on main.

Files Patch % Lines
...query/functionscore/FunctionScoreQueryBuilder.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #15404      +/-   ##
============================================
- Coverage     71.95%   71.92%   -0.03%     
+ Complexity    63254    63229      -25     
============================================
  Files          5224     5224              
  Lines        296079   296083       +4     
  Branches      42763    42764       +1     
============================================
- Hits         213030   212946      -84     
- Misses        65550    65671     +121     
+ Partials      17499    17466      -33     

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

@yuye-aws
Copy link
Member

Hi @gaobinlong and @zhichao-aws ! Can you help review this PR?

@zhichao-aws
Copy link
Member

I'd recommend @vibrantvarun take a look at this PR, thanks!

@yuye-aws
Copy link
Member

Hi @jdnvn ! The DCO checks have failed. Can you follow the guide https://github.com/opensearch-project/OpenSearch/pull/15404/checks?check_run_id=29224905792 to fix this?

@gaobinlong gaobinlong added the backport 2.x Backport to 2.x branch label Aug 26, 2024
Signed-off-by: jdnvn <joe@donovan.to>
Signed-off-by: jdnvn <joe@donovan.to>
Copy link
Contributor

❌ Gradle check result for 3258eea: 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 3258eea: SUCCESS

@jdnvn
Copy link
Author

jdnvn commented Aug 27, 2024

@yuye-aws @zhichao-aws @vibrantvarun hello, I updated the PR and CI is green now. Mind taking another look?

Comment on lines +711 to +715
public void visit(QueryBuilderVisitor visitor) {
visitor.accept(this);
if (query != null) {
visitor.getChildVisitor(BooleanClause.Occur.MUST).accept(query);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick -- it looks like the FunctionScoreQueryBuilder constructors guarantee that query can never be null, so the check is unnecessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A similar comment was made here, and the author opted to keep the null check to pass tests and keep consistent with the other implementations. Let me know and I can change it if you feel otherwise.

@jdnvn jdnvn requested a review from msfroh September 1, 2024 16:03
Copy link
Contributor

github-actions bot commented Sep 1, 2024

❌ Gradle check result for 39b50b9: 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 Sep 1, 2024

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

@yuye-aws
Copy link
Member

@jdnvn Can you fix the DCO and gradle check?

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 v2.17.0
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
6 participants