forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix negative scores returned from
multi_match
query with `cross_fie…
…lds` (opensearch-project#13829) (opensearch-project#13983) Signed-off-by: kkewwei <kkewwei@163.com>
- Loading branch information
Showing
8 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
35 changes: 35 additions & 0 deletions
35
rest-api-spec/src/main/resources/rest-api-spec/test/search/50_multi_match.yml
This file contains 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,35 @@ | ||
"Cross fields do not return negative scores": | ||
- skip: | ||
version: " - 2.99.99" | ||
reason: "This fix is in 2.15. Until we do the BWC dance, we need to skip all pre-3.0, though." | ||
- do: | ||
index: | ||
index: test | ||
id: 1 | ||
body: { "color" : "orange red yellow" } | ||
- do: | ||
index: | ||
index: test | ||
id: 2 | ||
body: { "color": "orange red purple", "shape": "red square" } | ||
- do: | ||
index: | ||
index: test | ||
id: 3 | ||
body: { "color" : "orange red yellow purple" } | ||
- do: | ||
indices.refresh: { } | ||
- do: | ||
search: | ||
index: test | ||
body: | ||
query: | ||
multi_match: | ||
query: "red" | ||
type: "cross_fields" | ||
fields: [ "color", "shape^100"] | ||
tie_breaker: 0.1 | ||
explain: true | ||
- match: { hits.total.value: 3 } | ||
- match: { hits.hits.0._id: "2" } | ||
- gt: { hits.hits.2._score: 0.0 } |
This file contains 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 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 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 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 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 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