updateedit

client.update({
  id: string,
  index: string,
  type: string,
  wait_for_active_shards: string,
  fields: string | string[],
  _source: string | string[],
  _source_exclude: string | string[],
  _source_include: string | string[],
  lang: string,
  parent: string,
  refresh: 'true' | 'false' | 'wait_for',
  retry_on_conflict: number,
  routing: string,
  timeout: string,
  timestamp: string,
  ttl: string,
  version: number,
  version_type: 'internal' | 'force',
  body: object
})

Reference

id

string - Document ID

index

string - The name of the index

type

string - The type of the document

wait_for_active_shards or waitForActiveShards

string - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)

fields

string | string[] - A comma-separated list of fields to return in the response

_source

string | string[] - True or false to return the _source field or not, or a list of fields to return

_source_exclude or _sourceExclude

string | string[] - A list of fields to exclude from the returned _source field

_source_include or _sourceInclude

string | string[] - A list of fields to extract and return from the _source field

lang

string - The script language (default: painless)

parent

string - ID of the parent document. Is is only used for routing and when for the upsert request

refresh

'true' | 'false' | 'wait_for' - If true then refresh the effected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false (the default) then do nothing with refreshes.

retry_on_conflict or retryOnConflict

number - Specify how many times should the operation be retried when a conflict occurs (default: 0)

routing

string - Specific routing value

timeout

string - Explicit operation timeout

timestamp

string - Explicit timestamp for the document

ttl

string - Expiration time for the document

version

number - Explicit version number for concurrency control

version_type or versionType

'internal' | 'force' - Specific version type

body

object - The request definition using either script or partial doc