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 *.
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 targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.
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 with open, closed, or both.none: Wildcard expressions are not accepted.Values are all, open, closed, hidden, or none.
Search operation type
Supported values include:
query_then_fetch: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.dfs_query_then_fetch: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.Values are query_then_fetch or dfs_query_then_fetch.
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)
)
)
)
);
{
"requests": [
{
"id": "JFK query",
"request": { "query": { "match_all": {} } },
"ratings": []
} ],
"metric": {
"precision": {
"k": 20,
"relevant_rating_threshold": 1,
"ignore_unlabeled": false
}
}
}