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

[Backport 2.x] Add support for scored named queries (#11626) #12427

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

andrross
Copy link
Member

Opensearch already support labelling the queries, that returns as a list in the returned results, of which query it matched. However one of the use case while doing hybrid search with query text and dense vector is to determine individual scores for each query type. This is very useful in further analysis and building offline model to generate better weights for ranking score. Hence adding this feature that sends the client to add the score for each matched query.


(cherry picked from commit 52b27f4)

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

Opensearch already support labelling the queries, that returns as a list in the returned results, of which query it
matched. However one of the use case while doing hybrid search with query text and dense vector is to determine
individual scores for each query type. This is very useful in further analysis and building offline model to generate
better weights for ranking score. Hence adding this feature that sends the client to add the score for each matched
query.

---------

Signed-off-by: Dharin Shah <[email protected]>
Signed-off-by: Dharin Shah <[email protected]>
Co-authored-by: Dharin Shah <[email protected]>
(cherry picked from commit 52b27f4)
Signed-off-by: Andrew Ross <[email protected]>
Copy link
Contributor

github-actions bot commented Feb 22, 2024

Compatibility status:

Checks if related components are compatible with change 56d080a

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/sql.git]

Copy link
Contributor

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

@andrross
Copy link
Member Author

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

Ugh...some version guards need to be updated. This also means the guards on main will have to be changed as soon as this PR is committed otherwise bwc tests will break.

Signed-off-by: Andrew Ross <[email protected]>
Copy link
Contributor

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

@reta
Copy link
Collaborator

reta commented Feb 22, 2024

Thanks @andrross !

@andrross andrross force-pushed the backport/backport-11626-to-2.x branch from 346583f to 5cc2675 Compare February 22, 2024 19:23
Copy link
Contributor

❌ Gradle check result for 346583f: 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 5cc2675: 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?

Co-authored-by: Andriy Redko <[email protected]>
Signed-off-by: Andrew Ross <[email protected]>
@andrross andrross force-pushed the backport/backport-11626-to-2.x branch from 5cc2675 to 56d080a Compare February 22, 2024 20:53
Copy link
Contributor

❌ Gradle check result for 56d080a: null

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?

@andrross
Copy link
Member Author

❌ Gradle check result for 56d080a: null

This check actually succeeded, but the GHA poller failed on one of its requests to Jenkins: https://build.ci.opensearch.org/job/gradle-check/34086/

Copy link
Contributor

❕ Gradle check result for 56d080a: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testMultiGetWithNetworkDisruption_FailOpenEnabled

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 Feb 22, 2024

Codecov Report

Attention: Patch coverage is 37.31343% with 84 lines in your changes are missing coverage. Please review.

Project coverage is 71.13%. Comparing base (8e24648) to head (56d080a).
Report is 3 commits behind head on 2.x.

Files Patch % Lines
...rch/search/fetch/subphase/MatchedQueriesPhase.java 0.00% 37 Missing ⚠️
...src/main/java/org/opensearch/search/SearchHit.java 58.73% 17 Missing and 9 partials ⚠️
...opensearch/search/builder/SearchSourceBuilder.java 42.85% 4 Missing and 4 partials ⚠️
...g/opensearch/search/internal/SubSearchContext.java 0.00% 3 Missing ⚠️
...opensearch/action/search/SearchRequestBuilder.java 0.00% 2 Missing ⚠️
...pensearch/rest/action/search/RestSearchAction.java 60.00% 1 Missing and 1 partial ⚠️
...nsearch/search/internal/FilteredSearchContext.java 0.00% 2 Missing ⚠️
.../org/opensearch/search/internal/SearchContext.java 0.00% 2 Missing ⚠️
...va/org/opensearch/search/DefaultSearchContext.java 75.00% 1 Missing ⚠️
...java/org/opensearch/search/fetch/FetchContext.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #12427      +/-   ##
============================================
- Coverage     71.13%   71.13%   -0.01%     
- Complexity    59948    59979      +31     
============================================
  Files          4945     4945              
  Lines        282230   282325      +95     
  Branches      41341    41365      +24     
============================================
+ Hits         200754   200821      +67     
- Misses        64470    64518      +48     
+ Partials      17006    16986      -20     

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

@reta reta merged commit 4e03b28 into opensearch-project:2.x Feb 23, 2024
28 of 29 checks passed
@@ -0,0 +1,103 @@
setup:
- skip:
version: " - 2.12.99"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@andrross my apologies, could you please bring this change to main? thank you

Copy link
Collaborator

Choose a reason for hiding this comment

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

@andrross andrross deleted the backport/backport-11626-to-2.x branch February 23, 2024 19:03
@Dharin-shah
Copy link
Contributor

Sorry i couldn't pick this up, thanks for handling it @andrross

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

Successfully merging this pull request may close these issues.

4 participants