getSource

edit
client.getSource([params, [callback]])

Get the source of a document by its index, type and id.

Check the API Conventions and the elasticsearch docs for more information pertaining to this method.

Params

parent

String — The ID of the parent document

preference

String — Specify the node or shard the operation should be performed on (default: random)

realtime

Boolean — Specify whether to perform the operation in realtime or search mode

refresh

Boolean — Refresh the shard containing the document before performing the operation

routing

String — Specific routing value

_source

String, String[], Boolean — True or false to return the _source field or not, or a list of fields to return

_sourceExcludes

String, String[], Boolean — A list of fields to exclude from the returned _source field

_sourceIncludes

String, String[], Boolean — A list of fields to extract and return from the _source field

version

Number — Explicit version number for concurrency control

versionType

String — Specific version type

Options
  • "internal"
  • "external"
  • "external_gte"
  • "force"

id

String — The document ID

index

String — The name of the index

type

String — The type of the document; use _all to fetch the first document matching the ID across all types

back to top