Evaluate the quality of ranked search results over a set of typical search queries.
Required authorization
- Index privileges:
read
Query parameters
-
A setting that does two separate checks on the index expression. If
false, the request returns an error (1) if any wildcard expression (including_alland*) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. Iftrue, index expressions that resolve to no indices are allowed and the request returns an empty result. -
Whether to expand wildcard expression to concrete indices that are open, closed or both.
Values are
all,open,closed,hidden, ornone. -
Search operation type
Values are
query_then_fetchordfs_query_then_fetch.
GET
/_rank_eval
curl \
--request GET 'http://api.example.com/_rank_eval' \
--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
}
}
}