Add rest test for rank_eval with security (elastic/x-pack-elasticsearch#4185)

Original commit: elastic/x-pack-elasticsearch@5f9001ec65
This commit is contained in:
Christoph Büscher 2018-03-22 12:01:12 +01:00 committed by GitHub
parent 0a525d4707
commit d12ee3898d
1 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,54 @@
---
"Basic Rankeval test":
- skip:
version: " - 6.2.99"
reason: response format was updated in 6.3
- do:
indices.create:
index: foo
body:
settings:
index:
number_of_shards: 1
- do:
index:
index: foo
type: bar
id: doc1
body: { "text": "berlin" }
- do:
index:
index: foo
type: bar
id: doc2
body: { "text": "amsterdam" }
- do:
indices.refresh: {}
- do:
rank_eval:
body: {
"requests" : [
{
"id": "amsterdam_query",
"request": { "query": { "match" : {"text" : "amsterdam" }}},
"ratings": [
{"_index": "foo", "_id": "doc1", "rating": 0},
{"_index": "foo", "_id": "doc2", "rating": 1}
]
},
{
"id" : "berlin_query",
"request": { "query": { "match" : { "text" : "berlin" } }, "size" : 10 },
"ratings": [{"_index": "foo", "_id": "doc1", "rating": 1}]
}
],
"metric" : { "precision": { "ignore_unlabeled" : true }}
}
- match: { quality_level: 1 }