From d12ee3898d5190354768a02e494ffcab60944335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 22 Mar 2018 12:01:12 +0100 Subject: [PATCH] Add rest test for rank_eval with security (elastic/x-pack-elasticsearch#4185) Original commit: elastic/x-pack-elasticsearch@5f9001ec656e5f3783a7824a2f25054978c74517 --- .../test/rankeval/10_rankeval.yml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 qa/core-rest-tests-with-security/src/test/resources/rest-api-spec/test/rankeval/10_rankeval.yml diff --git a/qa/core-rest-tests-with-security/src/test/resources/rest-api-spec/test/rankeval/10_rankeval.yml b/qa/core-rest-tests-with-security/src/test/resources/rest-api-spec/test/rankeval/10_rankeval.yml new file mode 100644 index 00000000000..8ef9dd908b6 --- /dev/null +++ b/qa/core-rest-tests-with-security/src/test/resources/rest-api-spec/test/rankeval/10_rankeval.yml @@ -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 } +