Explain a document match result
- POST also GET /{index}/_explain/{id}
Get information about why a specific document matches, or doesn't match, a query. It computes a score explanation for a query and a specific document.
- Index privileges:
read
Query Parameters
-
analyzerstring The analyzer to use for the query string. This parameter can be used only when the
qquery string parameter is specified.-
analyze_wildcardboolean · default: false If
true, wildcard and prefix queries are analyzed. This parameter can be used only when theqquery string parameter is specified.-
default_operatorOperator · default: or The default operator for query string query:
andoror. This parameter can be used only when theqquery string parameter is specified.-
Values:
andANDorOR -
dfstring The field to use as default where no field prefix is given in the query string. This parameter can be used only when the
qquery string parameter is specified.-
lenientboolean · default: false If
true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can be used only when theqquery string parameter is specified.-
preferencestring The node or shard the operation should be performed on. It is random by default.
-
routingRouting A custom value used to route operations to a specific shard. Not allowed when
index.slice.enabledistruefor the target index; use_sliceinstead.-
_sourceSourceConfigParam Trueorfalseto return the_sourcefield or not or a list of fields to return.-
_source_excludesFields A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in
_source_includesquery parameter. If the_sourceparameter isfalse, this parameter is ignored.-
_source_includesFields A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the
_source_excludesquery parameter. If the_sourceparameter isfalse, this parameter is ignored.-
stored_fieldsFields A comma-separated list of stored fields to return in the response.
-
qstring The query in the Lucene query string syntax.
Request
-
queryQueryContainer -
Defines the search definition using the Query DSL.
Response
-
_indexstring IndexNamerequired -
_idstring Idrequired -
matchedbooleanrequired -
explanationExplanationDetail -
descriptionstringrequired -
detailsExplanationDetail -
valuenumberrequired