forked from opensearch-project/opensearch-api-specification
-
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.
adding
rank_eval indices
API tests (opensearch-project#704)
* adding rank_eval indices api specs Signed-off-by: Tokesh <tokesh789@gmail.com> * lint for ci and verbose check early versions Signed-off-by: Tokesh <tokesh789@gmail.com> * adding _type parameter to rank-eval specs Signed-off-by: Tokesh <tokesh789@gmail.com> * fixing reference and adding changelog Signed-off-by: Tokesh <tokesh789@gmail.com> * adding rank_eval global Signed-off-by: Tokesh <tokesh789@gmail.com> * removing verbose flag from ci Signed-off-by: Tokesh <tokesh789@gmail.com> * missing one link in changelog Signed-off-by: Tokesh <tokesh789@gmail.com> --------- Signed-off-by: Tokesh <tokesh789@gmail.com> Signed-off-by: Niyazbek Torekeldi <78027392+Tokesh@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
134 additions
and
2 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test rank evaluation API using both GET and POST methods. | ||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: movies, _id: movie1}} | ||
- {director: Quentin Tarantino, title: Pulp Fiction, year: 1994} | ||
- {create: {_index: movies, _id: movie2}} | ||
- {director: Christopher Nolan, title: Inception, year: 2010} | ||
|
||
chapters: | ||
- synopsis: Perform rank evaluation using GET. | ||
path: /_rank_eval | ||
method: GET | ||
request: | ||
payload: | ||
metric: | ||
precision: | ||
k: 10 | ||
requests: | ||
- id: query_1 | ||
request: | ||
query: | ||
match: | ||
title: Pulp Fiction | ||
ratings: | ||
- _id: movie1 | ||
rating: 1 | ||
_index: movies | ||
response: | ||
status: 200 | ||
|
||
- synopsis: Perform rank evaluation using POST. | ||
path: /_rank_eval | ||
method: POST | ||
request: | ||
payload: | ||
metric: | ||
mean_reciprocal_rank: | ||
k: 10 | ||
requests: | ||
- id: query_2 | ||
request: | ||
query: | ||
match: | ||
director: Christopher Nolan | ||
ratings: | ||
- _id: movie2 | ||
_index: movies | ||
rating: 1 | ||
response: | ||
status: 200 |
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,66 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test rank evaluation API using both GET and POST methods. | ||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: movies, _id: movie1}} | ||
- {director: Quentin Tarantino, title: Pulp Fiction, year: 1994} | ||
- {create: {_index: movies, _id: movie2}} | ||
- {director: Christopher Nolan, title: Inception, year: 2010} | ||
|
||
chapters: | ||
- synopsis: Perform rank evaluation using GET. | ||
path: /{index}/_rank_eval | ||
method: GET | ||
parameters: | ||
index: movies | ||
request: | ||
payload: | ||
metric: | ||
precision: | ||
k: 10 | ||
requests: | ||
- id: query_1 | ||
request: | ||
query: | ||
match: | ||
title: Pulp Fiction | ||
ratings: | ||
- _id: movie1 | ||
rating: 1 | ||
_index: movies | ||
response: | ||
status: 200 | ||
|
||
- synopsis: Perform rank evaluation using POST. | ||
path: /{index}/_rank_eval | ||
method: POST | ||
parameters: | ||
index: [movies] | ||
request: | ||
payload: | ||
metric: | ||
mean_reciprocal_rank: | ||
k: 10 | ||
requests: | ||
- id: query_2 | ||
request: | ||
query: | ||
match: | ||
director: Christopher Nolan | ||
ratings: | ||
- _id: movie2 | ||
_index: movies | ||
rating: 1 | ||
response: | ||
status: 200 |