getSourceedit

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

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; deprecated and optional starting with 7.0

back to top