Enables you to evaluate the quality of ranked search results over a set of typical search queries Added in 6.2.0
Path parameters
-
Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard (
*
) expressions are supported. To target all data streams and indices in a cluster, omit this parameter or use_all
or*
.
Query parameters
-
allow_no_indices boolean
If
false
, the request returns an error if any wildcard expression, index alias, or_all
value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targetingfoo*,bar*
returns an error if an index starts withfoo
but no index starts withbar
. -
expand_wildcards string | array[string]
Whether to expand wildcard expression to concrete indices that are open, closed or both.
-
search_type string
Search operation type
POST /{index}/_rank_eval
curl \
-X POST http://api.example.com/{index}/_rank_eval \
-H "Content-Type: application/json" \
-d '{"requests":[{"id":"string","request":{"query":{},"size":42.0},"ratings":[{"_id":"string","_index":"string","rating":42.0}],"template_id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}}}],"metric":{"":{"k":42.0,"maximum_relevance":42.0}}}'
Request examples
{
"requests": [
{
"id": "string",
"request": {
"query": {},
"size": 42.0
},
"ratings": [
{
"_id": "string",
"_index": "string",
"rating": 42.0
}
],
"template_id": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
}
}
],
"metric": {
"": {
"k": 42.0,
"maximum_relevance": 42.0
}
}
}
Response examples (200)
{
"metric_score": 42.0,
"details": {
"additionalProperty1": {
"metric_score": 42.0,
"unrated_docs": [
{
"_id": "string",
"_index": "string"
}
],
"hits": [
{
"hit": {
"_id": "string",
"_index": "string",
"_score": 42.0
},
"rating": 42.0
}
],
"metric_details": {
"additionalProperty1": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"additionalProperty2": {
"additionalProperty1": {},
"additionalProperty2": {}
}
}
},
"additionalProperty2": {
"metric_score": 42.0,
"unrated_docs": [
{
"_id": "string",
"_index": "string"
}
],
"hits": [
{
"hit": {
"_id": "string",
"_index": "string",
"_score": 42.0
},
"rating": 42.0
}
],
"metric_details": {
"additionalProperty1": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"additionalProperty2": {
"additionalProperty1": {},
"additionalProperty2": {}
}
}
}
},
"failures": {
"additionalProperty1": {},
"additionalProperty2": {}
}
}