Explain a document match result

Auth

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.

Required privileges

Index privileges read

Path parameters

index string required

Index names that are used to limit the request. Only a single index name can be provided to this parameter.

id string required

The document identifier.

Query parameters

analyzer string

The analyzer to use for the query string. This parameter can be used only when the q query string parameter is specified.

analyze_wildcard boolean · default: false

If true, wildcard and prefix queries are analyzed. This parameter can be used only when the q query string parameter is specified.

default_operator enum · default: or

The default operator for query string query: and or or. This parameter can be used only when the q query string parameter is specified.

Values: and AND or OR
df string

The field to use as default where no field prefix is given in the query string. This parameter can be used only when the q query string parameter is specified.

lenient boolean · 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 the q query string parameter is specified.

preference string

The node or shard the operation should be performed on. It is random by default.

routing union string | string[]

A custom value used to route operations to a specific shard. Not allowed when index.slice.enabled is true for the target index; use _slice instead.

_source union oneOf

True or false to return the _source field or not or a list of fields to return.

One of: boolean or string
_source_excludes union string | string[]

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_includes query parameter. If the _source parameter is false, this parameter is ignored.

_source_includes union string | string[]

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_excludes query parameter. If the _source parameter is false, this parameter is ignored.

stored_fields union string | string[]

A comma-separated list of stored fields to return in the response.

q string

The query in the Lucene query string syntax.

Request body

query {} Query

Defines the search definition using the Query DSL.

Response

application/json
_index string required
_id string required
matched boolean required
explanation object
description string required
details object[]
Same fields as explanation
value number required
get object
fields map string to object
found boolean required
_seq_no number
_primary_term number
_routing union oneOf
One of: string[] or string
_source object