Search + K

Command Palette

Search for a command to run...

Sign In

Check for a document source

HEAD /{index}/_source/{id}
Copy endpoint

Check whether a document source exists in an index. For example:

HEAD my-index-000001/_source/1

A document's source is not available if it is disabled in the mapping.

Required authorization

  • Index privileges: read

Parameters

path Path Parameters

Name Type
index required

A comma-separated list of data streams, indices, and aliases. It supports wildcards (*).

type TypesIndexName = string
id required

A unique identifier for the document.

type TypesId = string

query Query Parameters

Name Type
preference

The node or shard the operation should be performed on. By default, the operation is randomized between the shard replicas.

string
realtime

If true, the request is real-time as opposed to near-real-time.

boolean
refresh

If true, the request refreshes the relevant shards before retrieving the document. Setting it to true should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).

boolean
routing

A custom value used to route operations to a specific shard.

type TypesRouting = string[] | string
_source

Indicates whether to return the _source field (true or false) or lists the fields to return.

type GlobalSearchTypesSourceConfigParam = type TypesFields = type TypesField = string | type TypesField = string[] | boolean
_source_excludes

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

type TypesFields = type TypesField = string | type TypesField = string[]
_source_includes

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

type TypesFields = type TypesField = string | type TypesField = string[]
version

The version number for concurrency control. It must match the current version of the document for the request to succeed.

type TypesVersionNumber = number
version_type

The version type.

type TypesVersionType = "internal" | "external" | "external_gte"

Responses

200 application/json
unknown