Explain a document match result

GET /{index}/_explain/{id}

Returns information about why a specific document matches, or doesn’t match, a query.

Path parameters

  • index string Required

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

  • id string Required

    Defines the document ID.

Query parameters

  • analyzer string

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

  • If true, wildcard and prefix queries are analyzed.

  • The default operator for query string query: AND or OR.

    Values are and, AND, or, or OR.

  • df string

    Field to use as default where no field prefix is given in the query string.

  • lenient boolean

    If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.

  • Specifies the node or shard the operation should be performed on. Random by default.

  • routing string

    Custom value used to route operations to a specific shard.

  • _source boolean | string | array[string]

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

  • _source_excludes string | array[string]

    A comma-separated list of source fields to exclude from the response.

  • _source_includes string | array[string]

    A comma-separated list of source fields to include in the response.

  • stored_fields string | array[string]

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

  • q string

    Query in the Lucene query string syntax.

application/json

Body

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
GET /{index}/_explain/{id}
curl \
 -X GET http://api.example.com/{index}/_explain/{id} \
 -H "Content-Type: application/json" \
 -d '{"query":{}}'
Request examples
{
  "query": {}
}
Response examples (200)
{
  "_index": "string",
  "_id": "string",
  "matched": true,
  "explanation": {
    "description": "string",
    "details": [
      {}
    ],
    "value": 42.0
  },
  "get": {
    "fields": {
      "additionalProperty1": {},
      "additionalProperty2": {}
    },
    "found": true,
    "_seq_no": 42.0,
    "_primary_term": 42.0,
    "_routing": "string",
    "_source": {}
  }
}