Evaluate ranked search results
Generally available; Added in 6.2.0
Evaluate the quality of ranked search results over a set of typical search queries.
Required authorization
- Index privileges:
read
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.
Values are
all
,open
,closed
,hidden
, ornone
. -
search_type
string Search operation type
POST
/_rank_eval
Console
GET /my-index-000001/_rank_eval
{
"requests": [
{
"id": "JFK query",
"request": { "query": { "match_all": {} } },
"ratings": []
} ],
"metric": {
"precision": {
"k": 20,
"relevant_rating_threshold": 1,
"ignore_unlabeled": false
}
}
}
curl \
--request POST 'http://api.example.com/_rank_eval' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '"{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}"'
Request example
An example body for a `GET /my-index-000001/_rank_eval` request.
{
"requests": [
{
"id": "JFK query",
"request": { "query": { "match_all": {} } },
"ratings": []
} ],
"metric": {
"precision": {
"k": 20,
"relevant_rating_threshold": 1,
"ignore_unlabeled": false
}
}
}