-
Notifications
You must be signed in to change notification settings - Fork 2.5k
add support for scored named queries #11626
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
msfroh
merged 35 commits into
opensearch-project:main
from
Dharin-shah:add-support-for-scored-named-queries
Feb 6, 2024
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
16b7c19
add support for scored named queries
Dharin-shah 3aef42e
fix changelog with correct PR reference
Dharin-shah 5f7740e
fix spotless check in opensearch core
Dharin-shah df77f7c
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah f01eb0a
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah d21e040
minor refactor
Dharin-shah b7ec2f2
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah 5b95b9a
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah 86fb57f
fix version check
Dharin-shah 590671d
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah 013cdd9
address review comments
Dharin-shah c025016
Merge branch 'add-support-for-scored-named-queries' of github.com:Dha…
Dharin-shah 9938f11
remove unused method
Dharin-shah 3bc6ade
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah 6ac87ef
spotless check
Dharin-shah 92a2d2b
Merge branch 'add-support-for-scored-named-queries' of github.com:Dha…
Dharin-shah 5b447e7
increase cluster timeout for flaky test
Dharin-shah 09257a3
add backwards compatible test for searchHit
Dharin-shah f661895
fix assertion by removing deprecated function
Dharin-shah 38c8546
spotless check fix
Dharin-shah b4ca402
add javadoc comment to getMatchedQueryScore
Dharin-shah 8226d2b
add includeNamedQueriesScore and check to generate scores during Matc…
Dharin-shah 580773e
spotless java fix
Dharin-shah 2bf0cc2
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah bb0c0d8
refactor MatchedQueriesPhase to return different processors depending…
Dharin-shah 860d2aa
cleanup MatchedQueriesPhase based on review comments
Dharin-shah 0bdfa7d
revert back java docs and header
Dharin-shah 3418647
remove immutable map init
Dharin-shah 6881e10
fix include_named_queries_score propogation through request
Dharin-shah 1c58949
fix backwards incompatible io stream
Dharin-shah 9487a23
fix backwards compatible tests
Dharin-shah 67b0bc3
fix boolean null check
Dharin-shah ffdf852
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah 2937d8e
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah 9920c36
Merge branch 'main' into add-support-for-scored-named-queries
Dharin-shah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
rest-api-spec/src/main/resources/rest-api-spec/test/search/350_matched_queries.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| setup: | ||
| - skip: | ||
| version: " - 2.12.0" | ||
| reason: "implemented for versions post 2.12.0" | ||
|
|
||
| --- | ||
| "matched queries": | ||
| - do: | ||
| indices.create: | ||
| index: test | ||
|
|
||
| - do: | ||
| bulk: | ||
| refresh: true | ||
| body: | ||
| - '{ "index" : { "_index" : "test_1", "_id" : "1" } }' | ||
| - '{"field" : 1 }' | ||
| - '{ "index" : { "_index" : "test_1", "_id" : "2" } }' | ||
| - '{"field" : [1, 2] }' | ||
|
|
||
| - do: | ||
| search: | ||
| index: test_1 | ||
| body: | ||
| query: | ||
| bool: { | ||
| should: [ | ||
| { | ||
| match: { | ||
| field: { | ||
| query: 1, | ||
| _name: match_field_1 | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| match: { | ||
| field: { | ||
| query: 2, | ||
| _name: match_field_2, | ||
| boost: 10 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| - match: {hits.total.value: 2} | ||
| - length: {hits.hits.0.matched_queries: 2} | ||
| - match: {hits.hits.0.matched_queries: [ "match_field_1", "match_field_2" ]} | ||
| - length: {hits.hits.1.matched_queries: 1} | ||
| - match: {hits.hits.1.matched_queries: [ "match_field_1" ]} | ||
|
|
||
| --- | ||
|
|
||
| "matched queries with scores": | ||
| - do: | ||
| indices.create: | ||
| index: test | ||
|
|
||
| - do: | ||
| bulk: | ||
| refresh: true | ||
| body: | ||
| - '{ "index" : { "_index" : "test_1", "_id" : "1" } }' | ||
| - '{"field" : 1 }' | ||
| - '{ "index" : { "_index" : "test_1", "_id" : "2" } }' | ||
| - '{"field" : [1, 2] }' | ||
|
|
||
| - do: | ||
| search: | ||
| include_named_queries_score: true | ||
| index: test_1 | ||
| body: | ||
| query: | ||
| bool: { | ||
| should: [ | ||
| { | ||
| match: { | ||
| field: { | ||
| query: 1, | ||
| _name: match_field_1 | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| match: { | ||
| field: { | ||
| query: 2, | ||
| _name: match_field_2, | ||
| boost: 10 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| - match: { hits.total.value: 2 } | ||
| - length: { hits.hits.0.matched_queries: 2 } | ||
| - match: { hits.hits.0.matched_queries.match_field_1: 1 } | ||
| - match: { hits.hits.0.matched_queries.match_field_2: 10 } | ||
| - length: { hits.hits.1.matched_queries: 1 } | ||
| - match: { hits.hits.1.matched_queries.match_field_1: 1 } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.