Get a document's source
/{index}/_source/{id} Get the source of a document. For example:
GET my-index-000001/_source/1
You can use the source filtering parameters to control which parts of the _source are returned:
GET my-index-000001/_source/1/?_source_includes=*.id&_source_excludes=entities
Required authorization
- Index privileges:
read
Parameters
path Path Parameters
| Name | Type |
|---|---|
index
required
The name of the index that contains the document. | type TypesIndexName = string |
id
required
A unique document identifier. | 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 | boolean |
refresh If | boolean |
routing A custom value used to route operations to a specific shard. | type TypesRouting = string[] | string |
_source Indicates whether to return the | 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" |