Path parameters
-
A 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
-
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
. -
Whether to expand wildcard expression to concrete indices that are open, closed or both.
Supported values include:
all
: Match any data stream or index, including hidden ones.open
: Match open, non-hidden indices. Also matches any non-hidden data stream.closed
: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.hidden
: Match hidden data streams and hidden indices. Must be combined withopen
,closed
, orboth
.none
: Wildcard expressions are not accepted.
Values are
all
,open
,closed
,hidden
, ornone
. -
Search operation type
POST /{index}/_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 } } }
resp = client.rank_eval( index="my-index-000001", requests=[ { "id": "JFK query", "request": { "query": { "match_all": {} } }, "ratings": [] } ], metric={ "precision": { "k": 20, "relevant_rating_threshold": 1, "ignore_unlabeled": False } }, )
const response = await client.rankEval({ index: "my-index-000001", requests: [ { id: "JFK query", request: { query: { match_all: {}, }, }, ratings: [], }, ], metric: { precision: { k: 20, relevant_rating_threshold: 1, ignore_unlabeled: false, }, }, });
response = client.rank_eval( index: "my-index-000001", body: { "requests": [ { "id": "JFK query", "request": { "query": { "match_all": {} } }, "ratings": [] } ], "metric": { "precision": { "k": 20, "relevant_rating_threshold": 1, "ignore_unlabeled": false } } } )
$resp = $client->rankEval([ "index" => "my-index-000001", "body" => [ "requests" => array( [ "id" => "JFK query", "request" => [ "query" => [ "match_all" => new ArrayObject([]), ], ], "ratings" => array( ), ], ), "metric" => [ "precision" => [ "k" => 20, "relevant_rating_threshold" => 1, "ignore_unlabeled" => false, ], ], ], ]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"requests":[{"id":"JFK query","request":{"query":{"match_all":{}}},"ratings":[]}],"metric":{"precision":{"k":20,"relevant_rating_threshold":1,"ignore_unlabeled":false}}}' "$ELASTICSEARCH_URL/my-index-000001/_rank_eval"
client.rankEval(r -> r .index("my-index-000001") .metric(m -> m .precision(p -> p .ignoreUnlabeled(false) .relevantRatingThreshold(1) .k(20) ) ) .requests(re -> re .id("JFK query") .request(req -> req .query(q -> q .matchAll(m -> m) ) ) ) );
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 } } }