Skip to content

Commit

Permalink
adding rank_eval indices api specs
Browse files Browse the repository at this point in the history
Signed-off-by: Tokesh <[email protected]>
  • Loading branch information
Tokesh committed Dec 2, 2024
1 parent b7e9744 commit 6dd7af2
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spec/schemas/_core.rank_eval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ components:
additionalProperties:
type: object
additionalProperties:
type: object
type: number
required:
- hits
- metric_details
Expand Down
66 changes: 66 additions & 0 deletions tests/default/indices/rank_eval.yaml
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"

Check failure on line 33 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Must use plain style scalar

Check failure on line 33 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
request:
query:
match:
title: "Pulp Fiction"

Check failure on line 37 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Must use plain style scalar

Check failure on line 37 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
ratings:
- _id: "movie1"

Check failure on line 39 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Must use plain style scalar

Check failure on line 39 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
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"

Check failure on line 56 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Must use plain style scalar

Check failure on line 56 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
request:
query:
match:
director: "Christopher Nolan"

Check failure on line 60 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Must use plain style scalar

Check failure on line 60 in tests/default/indices/rank_eval.yaml

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
ratings:
- _id: "movie2"
_index: movies
rating: 1
response:
status: 200

0 comments on commit 6dd7af2

Please sign in to comment.