AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityGenerally available since 6.2This functionality is generally available and ready for production usage.Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Evaluate the quality of ranked search results over a set of typical search queries.
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.
expand_wildcardsuniononeOf · default: open
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:allopenclosedhiddennone
ignore_unavailableboolean · default: false
If true, missing or closed indices are not included in the response.
The document’s index. For data streams, this should be the document’s backing index.
ratingnumberrequired
The document’s relevance with regard to this search request.
template_idstring
The search template Id
paramsmapstring to object
The search template parameters.
metricobject
Definition of the evaluation metric to calculate.
precisionobject
knumber · default: 10
Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query.
relevant_rating_thresholdnumber · default: 1
Sets the rating threshold above which documents are considered to be "relevant".
ignore_unlabeledboolean · default: false
Controls how unlabeled documents in the search results are counted. If set to true, unlabeled documents are ignored and neither count as relevant or irrelevant. Set to false (the default), they are treated as irrelevant.
recallobject
knumber · default: 10
Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query.
relevant_rating_thresholdnumber · default: 1
Sets the rating threshold above which documents are considered to be "relevant".
mean_reciprocal_rankobject
knumber · default: 10
Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query.
relevant_rating_thresholdnumber · default: 1
Sets the rating threshold above which documents are considered to be "relevant".
dcgobject
knumber · default: 10
Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query.
normalizeboolean · default: false
If set to true, this metric will calculate the Normalized DCG.
expected_reciprocal_rankobject
knumber · default: 10
Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query.
maximum_relevancenumberrequired
The highest relevance grade used in the user-supplied relevance judgments.
The overall evaluation quality calculated by the defined metric
detailsmapstring to objectrequired
The details section contains one entry for every query in the original requests section, keyed by the search request id
<string>object
metric_scorenumberrequired
The metric_score in the details section shows the contribution of this query to the global quality metric score
unrated_docsobject[]required
The unrated_docs section contains an _index and _id entry for each document in the search result for this query that didn’t have a ratings value. This can be used to ask the user to supply ratings for these documents
_idstringrequired
_indexstringrequired
hitsobject[]required
The hits section shows a grouping of the search results with their supplied ratings
hitobjectrequired
_idstringrequired
_indexstringrequired
_scorenumberrequired
ratingunionnumber | stringnullable
metric_detailsmapstring to string to objectrequired
The metric_details give additional information about the calculated quality metric (e.g. how many of the retrieved documents were relevant). The content varies for each metric but allows for better interpretation of the results