Adapting rank_eval integration tests

This commit is contained in:
Christoph Büscher 2017-03-14 12:21:28 -07:00
parent cf35545e2d
commit f5388e5799
2 changed files with 36 additions and 34 deletions

View File

@ -65,20 +65,20 @@
- match: { rank_eval.details.amsterdam_query.metric_details: {"relevant_docs_retrieved": 2, "docs_retrieved": 2}}
- length: { rank_eval.details.amsterdam_query.hits: 3}
- match: { rank_eval.details.amsterdam_query.hits.0.hit: {"_index" : "foo", "_type" : "bar", "_id" : "doc2", "_score" : 0.44839138}}
- match: { rank_eval.details.amsterdam_query.hits.0.hit._id: "doc2"}
- match: { rank_eval.details.amsterdam_query.hits.0.rating: 1}
- match: { rank_eval.details.amsterdam_query.hits.1.hit: {"_index" : "foo", "_type" : "bar", "_id" : "doc3", "_score" : 0.44839138}}
- match: { rank_eval.details.amsterdam_query.hits.1.hit._id: "doc3"}
- match: { rank_eval.details.amsterdam_query.hits.1.rating: 1}
- match: { rank_eval.details.amsterdam_query.hits.2.hit: {"_index" : "foo", "_type" : "bar", "_id" : "doc4", "_score" : 0.21492207}}
- match: { rank_eval.details.amsterdam_query.hits.2.hit._id: "doc4"}
- is_false: rank_eval.details.amsterdam_query.hits.2.rating
- match: { rank_eval.details.berlin_query.quality_level: 1.0}
- match: { rank_eval.details.berlin_query.unknown_docs: [ {"_index": "foo", "_type": "bar", "_id": "doc4"}]}
- match: { rank_eval.details.berlin_query.metric_details: {"relevant_docs_retrieved": 1, "docs_retrieved": 1}}
- length: { rank_eval.details.berlin_query.hits: 2}
- match: { rank_eval.details.berlin_query.hits.0.hit: { "_index" : "foo", "_type" : "bar", "_id" : "doc1", "_score" : 0.87138504}}
- match: { rank_eval.details.berlin_query.hits.0.hit._id: "doc1" }
- match: { rank_eval.details.berlin_query.hits.0.rating: 1}
- match: { rank_eval.details.berlin_query.hits.1.hit: { "_index" : "foo", "_type" : "bar", "_id" : "doc4", "_score" : 0.41767058}}
- match: { rank_eval.details.berlin_query.hits.1.hit._id: "doc4" }
- is_false: rank_eval.details.berlin_query.hits.1.rating
---

View File

@ -21,19 +21,21 @@
type: bar
id: doc3
body: { "bar": 3 }
- do:
index:
index: foo
type: bar
id: doc4
body: { "bar": 4 }
- do:
index:
index: foo
type: bar
id: doc5
body: { "bar": 5 }
- do:
index:
index: foo
@ -95,34 +97,34 @@
# if we mix both, we should get the average
- do:
rank_eval:
body: {
"requests" : [
{
"id": "dcg_query",
"request": { "query": { "match_all" : {}}, "sort" : [ "bar" ] },
"ratings": [
{"_index" : "foo", "_type" : "bar", "_id" : "doc1", "rating": 3},
{"_index" : "foo", "_type" : "bar", "_id" : "doc2", "rating": 2},
{"_index" : "foo", "_type" : "bar", "_id" : "doc3", "rating": 3},
{"_index" : "foo", "_type" : "bar", "_id" : "doc4", "rating": 0},
{"_index" : "foo", "_type" : "bar", "_id" : "doc5", "rating": 1},
{"_index" : "foo", "_type" : "bar", "_id" : "doc6", "rating": 2}]
},
{
"id": "dcg_query_reverse",
"request": { "query": { "match_all" : {}}, "sort" : [ {"bar" : "desc" }] },
"ratings": [
{"_index" : "foo", "_type" : "bar", "_id" : "doc1", "rating": 3},
{"_index" : "foo", "_type" : "bar", "_id" : "doc2", "rating": 2},
{"_index" : "foo", "_type" : "bar", "_id" : "doc3", "rating": 3},
{"_index" : "foo", "_type" : "bar", "_id" : "doc4", "rating": 0},
{"_index" : "foo", "_type" : "bar", "_id" : "doc5", "rating": 1},
{"_index" : "foo", "_type" : "bar", "_id" : "doc6", "rating": 2}]
},
],
"metric" : { "dcg": { }}
}
rank_eval:
body: {
"requests" : [
{
"id": "dcg_query",
"request": { "query": { "match_all" : {}}, "sort" : [ "bar" ] },
"ratings": [
{"_index" : "foo", "_type" : "bar", "_id" : "doc1", "rating": 3},
{"_index" : "foo", "_type" : "bar", "_id" : "doc2", "rating": 2},
{"_index" : "foo", "_type" : "bar", "_id" : "doc3", "rating": 3},
{"_index" : "foo", "_type" : "bar", "_id" : "doc4", "rating": 0},
{"_index" : "foo", "_type" : "bar", "_id" : "doc5", "rating": 1},
{"_index" : "foo", "_type" : "bar", "_id" : "doc6", "rating": 2}]
},
{
"id": "dcg_query_reverse",
"request": { "query": { "match_all" : {}}, "sort" : [ {"bar" : "desc" }] },
"ratings": [
{"_index" : "foo", "_type" : "bar", "_id" : "doc1", "rating": 3},
{"_index" : "foo", "_type" : "bar", "_id" : "doc2", "rating": 2},
{"_index" : "foo", "_type" : "bar", "_id" : "doc3", "rating": 3},
{"_index" : "foo", "_type" : "bar", "_id" : "doc4", "rating": 0},
{"_index" : "foo", "_type" : "bar", "_id" : "doc5", "rating": 1},
{"_index" : "foo", "_type" : "bar", "_id" : "doc6", "rating": 2}]
},
],
"metric" : { "dcg": { }}
}
- match: {rank_eval.quality_level: 12.073969010408984}
- match: {rank_eval.details.dcg_query.quality_level: 13.84826362927298}