Skip to content

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

Merged
reta merged 3 commits into
opensearch-project:2.xfrom
andrross:backport/backport-11626-to-2.x
Feb 23, 2024
Merged

[Backport 2.x] Add support for scored named queries (#11626)#12427
reta merged 3 commits into
opensearch-project:2.xfrom
andrross:backport/backport-11626-to-2.x

Conversation

@andrross
Copy link
Copy Markdown
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 <8616130+Dharin-shah@users.noreply.github.com>
Signed-off-by: Dharin Shah <Dharin-shah@users.noreply.github.com>
Co-authored-by: Dharin Shah <8616130+Dharin-shah@users.noreply.github.com>
(cherry picked from commit 52b27f4)
Signed-off-by: Andrew Ross <andrross@amazon.com>
@github-actions
Copy link
Copy Markdown
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]

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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 <andrross@amazon.com>
@github-actions
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
@github-actions
Copy link
Copy Markdown
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?

@github-actions
Copy link
Copy Markdown
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 <drreta@gmail.com>
Signed-off-by: Andrew Ross <andrross@amazon.com>
@andrross andrross force-pushed the backport/backport-11626-to-2.x branch from 5cc2675 to 56d080a Compare February 22, 2024 20:53
@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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/

@github-actions
Copy link
Copy Markdown
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.

@codecov
Copy link
Copy Markdown

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
@@ -0,0 +1,103 @@
setup:
- skip:
version: " - 2.12.99"
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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