Skip to content

Commit db24182

Browse files
committed
Adds rank_eval test
1 parent b006aca commit db24182

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/rank_eval.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
setup:
3+
- do:
4+
index:
5+
index: "my-index-000001"
6+
id: "doc1"
7+
refresh: true
8+
body: { text: 'travelling to Amsterdam' }
9+
---
10+
teardown:
11+
- do:
12+
indices.delete: { index: "my-index-000001" }
13+
---
14+
"rank eval":
15+
- do:
16+
rank_eval:
17+
index: "my-index-000001"
18+
body:
19+
requests:
20+
- id: "amsterdam_query"
21+
request: { query: { match: { text: "amsterdam" } } }
22+
ratings:
23+
- { "_index": "my-index-000001", "_id": "doc1", "rating": 0 }
24+
- { "_index": "my-index-000001", "_id": "doc2", "rating": 3 }
25+
- { "_index": "my-index-000001", "_id": "doc3", "rating": 1 }
26+
metric:
27+
precision:
28+
k: 5
29+
- match: { details.amsterdam_query.hits.0.hit._index: 'my-index-000001' }

0 commit comments

Comments
 (0)