[[api-reference]]
== API Reference

////////

This documentation is generated by running:
node scripts/run.js --tag tagName
or
node scripts/run.js --branch branchName

////////

=== Common parameters
Parameters that are accepted by all API endpoints.

link:{ref}/common-options.html[Reference]
[cols=2*]
|===
|`pretty`
|`boolean` - Pretty format the returned JSON response.

|`human`
|`boolean` - Return human readable values for statistics. +
    _Default:_ `true`

|`error_trace` or `errorTrace`
|`boolean` - Include the stack trace of returned errors.

|`source`
|`string` - The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

|`filter_path` or `filterPath`
|`list` - A comma-separated list of filters used to reduce the respone.

|===
=== bulk
[source,ts]
----
client.bulk({
  index: string,
  type: string,
  wait_for_active_shards: string,
  refresh: 'true' | 'false' | 'wait_for',
  routing: string,
  timeout: string,
  type: string,
  fields: string | string[],
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  pipeline: string,
  body: object
})
----
link:{ref}/docs-bulk.html[Reference]
[cols=2*]
|===
|`index`
|`string` - Default index for items which don't provide one

|`type`
|`string` - Default document type for items which don't provide one

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of shard copies that must be active before proceeding with the bulk 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)

|`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.

|`routing`
|`string` - Specific routing value

|`timeout`
|`string` - Explicit operation timeout

|`type`
|`string` - Default document type for items which don't provide one

|`fields`
|`string \| string[]` - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request

|`_source`
|`string \| string[]` - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - Default list of fields to extract and return from the _source field, can be overridden on each sub-request

|`pipeline`
|`string` - The pipeline id to preprocess incoming documents with

|`body`
|`object` - The operation definition and data (action-data pairs), separated by newlines

|===

=== cat.aliases
[source,ts]
----
client.cat.aliases({
  name: string | string[],
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-alias.html[Reference]
[cols=2*]
|===
|`name`
|`string \| string[]` - A comma-separated list of alias names to return

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.allocation
[source,ts]
----
client.cat.allocation({
  node_id: string | string[],
  format: string,
  bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-allocation.html[Reference]
[cols=2*]
|===
|`node_id` or `nodeId`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.count
[source,ts]
----
client.cat.count({
  index: string | string[],
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-count.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to limit the returned information

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.fielddata
[source,ts]
----
client.cat.fielddata({
  fields: string | string[],
  format: string,
  bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean,
  fields: string | string[]
})
----
link:{ref}/cat-fielddata.html[Reference]
[cols=2*]
|===
|`fields`
|`string \| string[]` - A comma-separated list of fields to return the fielddata size

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|`fields`
|`string \| string[]` - A comma-separated list of fields to return in the output

|===

=== cat.health
[source,ts]
----
client.cat.health({
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  ts: boolean,
  v: boolean
})
----
link:{ref}/cat-health.html[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`ts`
|`boolean` - Set to false to disable timestamping +
_Default:_ `true`

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.help
[source,ts]
----
client.cat.help({
  help: boolean,
  s: string | string[]
})
----
link:{ref}/cat.html[Reference]
[cols=2*]
|===
|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|===

=== cat.indices
[source,ts]
----
client.cat.indices({
  index: string | string[],
  format: string,
  bytes: 'b' | 'k' | 'm' | 'g',
  local: boolean,
  master_timeout: string,
  h: string | string[],
  health: 'green' | 'yellow' | 'red',
  help: boolean,
  pri: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-indices.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to limit the returned information

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`bytes`
|`'b' \| 'k' \| 'm' \| 'g'` - The unit in which to display byte values

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`health`
|`'green' \| 'yellow' \| 'red'` - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status

|`help`
|`boolean` - Return help information

|`pri`
|`boolean` - Set to true to return stats only for primary shards

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.master
[source,ts]
----
client.cat.master({
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-master.html[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.nodeattrs
[source,ts]
----
client.cat.nodeattrs({
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-nodeattrs.html[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.nodes
[source,ts]
----
client.cat.nodes({
  format: string,
  full_id: boolean,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-nodes.html[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`full_id` or `fullId`
|`boolean` - Return the full node ID instead of the shortened version (default: false)

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.pendingTasks
[source,ts]
----
client.cat.pendingTasks({
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-pending-tasks.html[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.plugins
[source,ts]
----
client.cat.plugins({
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-plugins.html[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.recovery
[source,ts]
----
client.cat.recovery({
  index: string | string[],
  format: string,
  bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-recovery.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to limit the returned information

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.repositories
[source,ts]
----
client.cat.repositories({
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-repositories.html[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.segments
[source,ts]
----
client.cat.segments({
  index: string | string[],
  format: string,
  bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-segments.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to limit the returned information

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.shards
[source,ts]
----
client.cat.shards({
  index: string | string[],
  format: string,
  bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-shards.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to limit the returned information

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.snapshots
[source,ts]
----
client.cat.snapshots({
  repository: string | string[],
  format: string,
  ignore_unavailable: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string \| string[]` - Name of repository from which to fetch the snapshot information

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Set to true to ignore unavailable snapshots

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.tasks
[source,ts]
----
client.cat.tasks({
  format: string,
  node_id: string | string[],
  actions: string | string[],
  detailed: boolean,
  parent_task: number,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/tasks.html[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`node_id` or `nodeId`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes

|`actions`
|`string \| string[]` - A comma-separated list of actions that should be returned. Leave empty to return all.

|`detailed`
|`boolean` - Return detailed task information (default: false)

|`parent_task` or `parentTask`
|`number` - Return tasks with specified parent task id. Set to -1 to return all.

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.templates
[source,ts]
----
client.cat.templates({
  name: string,
  format: string,
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-templates.html[Reference]
[cols=2*]
|===
|`name`
|`string` - A pattern that returned template names must match

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== cat.threadPool
[source,ts]
----
client.cat.threadPool({
  thread_pool_patterns: string | string[],
  format: string,
  size: '' | 'k' | 'm' | 'g' | 't' | 'p',
  local: boolean,
  master_timeout: string,
  h: string | string[],
  help: boolean,
  s: string | string[],
  v: boolean
})
----
link:{ref}/cat-thread-pool.html[Reference]
[cols=2*]
|===
|`thread_pool_patterns` or `threadPoolPatterns`
|`string \| string[]` - A comma-separated list of regular-expressions to filter the thread pools in the output

|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`size`
|`'' \| 'k' \| 'm' \| 'g' \| 't' \| 'p'` - The multiplier in which to display values

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`h`
|`string \| string[]` - Comma-separated list of column names to display

|`help`
|`boolean` - Return help information

|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by

|`v`
|`boolean` - Verbose mode. Display column headers

|===

=== clearScroll
[source,ts]
----
client.clearScroll({
  scroll_id: string | string[],
  body: object
})
----
link:{ref}/search-request-scroll.html[Reference]
[cols=2*]
|===
|`scroll_id` or `scrollId`
|`string \| string[]` - A comma-separated list of scroll IDs to clear

|`body`
|`object` - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter

|===

=== cluster.allocationExplain
[source,ts]
----
client.cluster.allocationExplain({
  include_yes_decisions: boolean,
  include_disk_info: boolean,
  body: object
})
----
link:{ref}/cluster-allocation-explain.html[Reference]
[cols=2*]
|===
|`include_yes_decisions` or `includeYesDecisions`
|`boolean` - Return 'YES' decisions in explanation (default: false)

|`include_disk_info` or `includeDiskInfo`
|`boolean` - Return information about disk usage and shard sizes (default: false)

|`body`
|`object` - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'

|===

=== cluster.getSettings
[source,ts]
----
client.cluster.getSettings({
  flat_settings: boolean,
  master_timeout: string,
  timeout: string,
  include_defaults: boolean
})
----
link:{ref}/cluster-update-settings.html[Reference]
[cols=2*]
|===
|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|`include_defaults` or `includeDefaults`
|`boolean` - Whether to return all default clusters setting.

|===

=== cluster.health
[source,ts]
----
client.cluster.health({
  index: string | string[],
  level: 'cluster' | 'indices' | 'shards',
  local: boolean,
  master_timeout: string,
  timeout: string,
  wait_for_active_shards: string,
  wait_for_nodes: string,
  wait_for_events: 'immediate' | 'urgent' | 'high' | 'normal' | 'low' | 'languid',
  wait_for_no_relocating_shards: boolean,
  wait_for_no_initializing_shards: boolean,
  wait_for_status: 'green' | 'yellow' | 'red'
})
----
link:{ref}/cluster-health.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - Limit the information returned to a specific index

|`level`
|`'cluster' \| 'indices' \| 'shards'` - Specify the level of detail for returned information +
_Default:_ `cluster`

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Wait until the specified number of shards is active

|`wait_for_nodes` or `waitForNodes`
|`string` - Wait until the specified number of nodes is available

|`wait_for_events` or `waitForEvents`
|`'immediate' \| 'urgent' \| 'high' \| 'normal' \| 'low' \| 'languid'` - Wait until all currently queued events with the given priority are processed

|`wait_for_no_relocating_shards` or `waitForNoRelocatingShards`
|`boolean` - Whether to wait until there are no relocating shards in the cluster

|`wait_for_no_initializing_shards` or `waitForNoInitializingShards`
|`boolean` - Whether to wait until there are no initializing shards in the cluster

|`wait_for_status` or `waitForStatus`
|`'green' \| 'yellow' \| 'red'` - Wait until cluster is in a specific state

|===

=== cluster.pendingTasks
[source,ts]
----
client.cluster.pendingTasks({
  local: boolean,
  master_timeout: string
})
----
link:{ref}/cluster-pending.html[Reference]
[cols=2*]
|===
|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|===

=== cluster.putSettings
[source,ts]
----
client.cluster.putSettings({
  flat_settings: boolean,
  master_timeout: string,
  timeout: string,
  body: object
})
----
link:{ref}/cluster-update-settings.html[Reference]
[cols=2*]
|===
|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|`body`
|`object` - The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).

|===

=== cluster.remoteInfo
[source,ts]
----
client.cluster.remoteInfo()
----
link:{ref}/cluster-remote-info.html[Reference]


=== cluster.reroute
[source,ts]
----
client.cluster.reroute({
  dry_run: boolean,
  explain: boolean,
  retry_failed: boolean,
  metric: string | string[],
  master_timeout: string,
  timeout: string,
  body: object
})
----
link:{ref}/cluster-reroute.html[Reference]
[cols=2*]
|===
|`dry_run` or `dryRun`
|`boolean` - Simulate the operation only and return the resulting state

|`explain`
|`boolean` - Return an explanation of why the commands can or cannot be executed

|`retry_failed` or `retryFailed`
|`boolean` - Retries allocation of shards that are blocked due to too many subsequent allocation failures

|`metric`
|`string \| string[]` - Limit the information returned to the specified metrics. Defaults to all but metadata

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|`body`
|`object` - The definition of `commands` to perform (`move`, `cancel`, `allocate`)

|===

=== cluster.state
[source,ts]
----
client.cluster.state({
  index: string | string[],
  metric: string | string[],
  local: boolean,
  master_timeout: string,
  flat_settings: boolean,
  wait_for_metadata_version: number,
  wait_for_timeout: string,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/cluster-state.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`metric`
|`string \| string[]` - Limit the information returned to the specified metrics

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`wait_for_metadata_version` or `waitForMetadataVersion`
|`number` - Wait for the metadata version to be equal or greater than the specified metadata version

|`wait_for_timeout` or `waitForTimeout`
|`string` - The maximum time to wait for wait_for_metadata_version before timing out

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|===

=== cluster.stats
[source,ts]
----
client.cluster.stats({
  node_id: string | string[],
  flat_settings: boolean,
  timeout: string
})
----
link:{ref}/cluster-stats.html[Reference]
[cols=2*]
|===
|`node_id` or `nodeId`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`timeout`
|`string` - Explicit operation timeout

|===

=== count
[source,ts]
----
client.count({
  index: string | string[],
  type: string | string[],
  ignore_unavailable: boolean,
  ignore_throttled: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  min_score: number,
  preference: string,
  routing: string | string[],
  q: string,
  analyzer: string,
  analyze_wildcard: boolean,
  default_operator: 'AND' | 'OR',
  df: string,
  lenient: boolean,
  terminate_after: number,
  body: object
})
----
link:{ref}/search-count.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of indices to restrict the results

|`type`
|`string \| string[]` - A comma-separated list of types to restrict the results

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`ignore_throttled` or `ignoreThrottled`
|`boolean` - Whether specified concrete, expanded or aliased indices should be ignored when throttled

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`min_score` or `minScore`
|`number` - Include only documents with a specific `_score` value in the result

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random)

|`routing`
|`string \| string[]` - A comma-separated list of specific routing values

|`q`
|`string` - Query in the Lucene query string syntax

|`analyzer`
|`string` - The analyzer to use for the query string

|`analyze_wildcard` or `analyzeWildcard`
|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)

|`default_operator` or `defaultOperator`
|`'AND' \| 'OR'` - The default operator for query string query (AND or OR) +
_Default:_ `OR`

|`df`
|`string` - The field to use as default where no field prefix is given in the query string

|`lenient`
|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

|`terminate_after` or `terminateAfter`
|`number` - The maximum count for each shard, upon reaching which the query execution will terminate early

|`body`
|`object` - A query to restrict the results specified with the Query DSL (optional)

|===

=== create
[source,ts]
----
client.create({
  id: string,
  index: string,
  type: string,
  wait_for_active_shards: string,
  parent: string,
  refresh: 'true' | 'false' | 'wait_for',
  routing: string,
  timeout: string,
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force',
  pipeline: string,
  body: object
})
----
link:{ref}/docs-index_.html[Reference]
[cols=2*]
|===
|`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 index 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)

|`parent`
|`string` - ID of the parent document

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected 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.

|`routing`
|`string` - Specific routing value

|`timeout`
|`string` - Explicit operation timeout

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|`pipeline`
|`string` - The pipeline id to preprocess incoming documents with

|`body`
|`object` - The document

|===

=== delete
[source,ts]
----
client.delete({
  id: string,
  index: string,
  type: string,
  wait_for_active_shards: string,
  parent: string,
  refresh: 'true' | 'false' | 'wait_for',
  routing: string,
  timeout: string,
  if_seq_no: number,
  if_primary_term: number,
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force'
})
----
link:{ref}/docs-delete.html[Reference]
[cols=2*]
|===
|`id`
|`string` - The 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 delete 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)

|`parent`
|`string` - ID of parent document

|`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.

|`routing`
|`string` - Specific routing value

|`timeout`
|`string` - Explicit operation timeout

|`if_seq_no` or `ifSeqNo`
|`number` - only perform the delete operation if the last operation that has changed the document has the specified sequence number

|`if_primary_term` or `ifPrimaryTerm`
|`number` - only perform the delete operation if the last operation that has changed the document has the specified primary term

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|===

=== deleteByQuery
[source,ts]
----
client.deleteByQuery({
  index: string | string[],
  type: string | string[],
  analyzer: string,
  analyze_wildcard: boolean,
  default_operator: 'AND' | 'OR',
  df: string,
  from: number,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  conflicts: 'abort' | 'proceed',
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  lenient: boolean,
  preference: string,
  q: string,
  routing: string | string[],
  scroll: string,
  search_type: 'query_then_fetch' | 'dfs_query_then_fetch',
  search_timeout: string,
  size: number,
  sort: string | string[],
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  terminate_after: number,
  stats: string | string[],
  version: boolean,
  request_cache: boolean,
  refresh: boolean,
  timeout: string,
  wait_for_active_shards: string,
  scroll_size: number,
  wait_for_completion: boolean,
  requests_per_second: number,
  slices: number,
  body: object
})
----
link:{ref}/docs-delete-by-query.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices

|`type`
|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types

|`analyzer`
|`string` - The analyzer to use for the query string

|`analyze_wildcard` or `analyzeWildcard`
|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)

|`default_operator` or `defaultOperator`
|`'AND' \| 'OR'` - The default operator for query string query (AND or OR) +
_Default:_ `OR`

|`df`
|`string` - The field to use as default where no field prefix is given in the query string

|`from`
|`number` - Starting offset (default: 0)

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`conflicts`
|`'abort' \| 'proceed'` - What to do when the delete by query hits version conflicts? +
_Default:_ `abort`

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`lenient`
|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random)

|`q`
|`string` - Query in the Lucene query string syntax

|`routing`
|`string \| string[]` - A comma-separated list of specific routing values

|`scroll`
|`string` - Specify how long a consistent view of the index should be maintained for scrolled search

|`search_type` or `searchType`
|`'query_then_fetch' \| 'dfs_query_then_fetch'` - Search operation type

|`search_timeout` or `searchTimeout`
|`string` - Explicit timeout for each search request. Defaults to no timeout.

|`size`
|`number` - Number of hits to return (default: 10)

|`sort`
|`string \| string[]` - A comma-separated list of <field>:<direction> pairs

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

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`terminate_after` or `terminateAfter`
|`number` - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.

|`stats`
|`string \| string[]` - Specific 'tag' of the request for logging and statistical purposes

|`version`
|`boolean` - Specify whether to return document version as part of a hit

|`request_cache` or `requestCache`
|`boolean` - Specify if request cache should be used for this request or not, defaults to index level setting

|`refresh`
|`boolean` - Should the effected indexes be refreshed?

|`timeout`
|`string` - Time each individual bulk request should wait for shards that are unavailable. +
_Default:_ `1m`

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of shard copies that must be active before proceeding with the delete by query 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)

|`scroll_size` or `scrollSize`
|`number` - Size on the scroll request powering the delete by query

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Should the request should block until the delete by query is complete. +
_Default:_ `true`

|`requests_per_second` or `requestsPerSecond`
|`number` - The throttle for this request in sub-requests per second. -1 means no throttle.

|`slices`
|`number` - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. +
_Default:_ `1`

|`body`
|`object` - The search definition using the Query DSL

|===

=== deleteByQueryRethrottle
[source,ts]
----
client.deleteByQueryRethrottle({
  task_id: string,
  requests_per_second: number
})
----
link:{ref}/docs-delete-by-query.html[Reference]
[cols=2*]
|===
|`task_id` or `taskId`
|`string` - The task id to rethrottle

|`requests_per_second` or `requestsPerSecond`
|`number` - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.

|===

=== deleteScript
[source,ts]
----
client.deleteScript({
  id: string,
  timeout: string,
  master_timeout: string
})
----
link:{ref}/modules-scripting.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Script ID

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|===

=== exists
[source,ts]
----
client.exists({
  id: string,
  index: string,
  type: string,
  stored_fields: string | string[],
  parent: string,
  preference: string,
  realtime: boolean,
  refresh: boolean,
  routing: string,
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force'
})
----
link:{ref}/docs-get.html[Reference]
[cols=2*]
|===
|`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)

|`stored_fields` or `storedFields`
|`string \| string[]` - A comma-separated list of stored fields to return in the response

|`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[]` - True or false to return the _source field or not, or a list of fields to return

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|===

=== existsSource
[source,ts]
----
client.existsSource({
  id: string,
  index: string,
  type: string,
  parent: string,
  preference: string,
  realtime: boolean,
  refresh: boolean,
  routing: string,
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force'
})
----
link:{ref}/docs-get.html[Reference]
[cols=2*]
|===
|`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

|`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[]` - True or false to return the _source field or not, or a list of fields to return

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|===

=== explain
[source,ts]
----
client.explain({
  id: string,
  index: string,
  type: string,
  analyze_wildcard: boolean,
  analyzer: string,
  default_operator: 'AND' | 'OR',
  df: string,
  stored_fields: string | string[],
  lenient: boolean,
  parent: string,
  preference: string,
  q: string,
  routing: string,
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  body: object
})
----
link:{ref}/search-explain.html[Reference]
[cols=2*]
|===
|`id`
|`string` - The document ID

|`index`
|`string` - The name of the index

|`type`
|`string` - The type of the document

|`analyze_wildcard` or `analyzeWildcard`
|`boolean` - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)

|`analyzer`
|`string` - The analyzer for the query string query

|`default_operator` or `defaultOperator`
|`'AND' \| 'OR'` - The default operator for query string query (AND or OR) +
_Default:_ `OR`

|`df`
|`string` - The default field for query string query (default: _all)

|`stored_fields` or `storedFields`
|`string \| string[]` - A comma-separated list of stored fields to return in the response

|`lenient`
|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

|`parent`
|`string` - The ID of the parent document

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random)

|`q`
|`string` - Query in the Lucene query string syntax

|`routing`
|`string` - Specific routing value

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

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`body`
|`object` - The query definition using the Query DSL

|===

=== fieldCaps
[source,ts]
----
client.fieldCaps({
  index: string | string[],
  fields: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  body: object
})
----
link:{ref}/search-field-caps.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`fields`
|`string \| string[]` - A comma-separated list of field names

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`body`
|`object` - Field json objects containing an array of field names

|===

=== get
[source,ts]
----
client.get({
  id: string,
  index: string,
  type: string,
  stored_fields: string | string[],
  parent: string,
  preference: string,
  realtime: boolean,
  refresh: boolean,
  routing: string,
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  _source_exclude: string | string[],
  _source_include: string | string[],
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force'
})
----
link:{ref}/docs-get.html[Reference]
[cols=2*]
|===
|`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)

|`stored_fields` or `storedFields`
|`string \| string[]` - A comma-separated list of stored fields to return in the response

|`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[]` - True or false to return the _source field or not, or a list of fields to return

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`_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

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|===

=== getScript
[source,ts]
----
client.getScript({
  id: string,
  master_timeout: string
})
----
link:{ref}/modules-scripting.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Script ID

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|===

=== getSource
[source,ts]
----
client.getSource({
  id: string,
  index: string,
  type: string,
  parent: string,
  preference: string,
  realtime: boolean,
  refresh: boolean,
  routing: string,
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force'
})
----
link:{ref}/docs-get.html[Reference]
[cols=2*]
|===
|`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

|`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[]` - True or false to return the _source field or not, or a list of fields to return

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|===

=== index
[source,ts]
----
client.index({
  id: string,
  index: string,
  type: string,
  wait_for_active_shards: string,
  op_type: 'index' | 'create',
  parent: string,
  refresh: 'true' | 'false' | 'wait_for',
  routing: string,
  timeout: string,
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force',
  if_seq_no: number,
  if_primary_term: number,
  pipeline: string,
  body: object
})
----
link:{ref}/docs-index_.html[Reference]
[cols=2*]
|===
|`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 index 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)

|`op_type` or `opType`
|`'index' \| 'create'` - Explicit operation type +
_Default:_ `index`

|`parent`
|`string` - ID of the parent document

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected 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.

|`routing`
|`string` - Specific routing value

|`timeout`
|`string` - Explicit operation timeout

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|`if_seq_no` or `ifSeqNo`
|`number` - only perform the index operation if the last operation that has changed the document has the specified sequence number

|`if_primary_term` or `ifPrimaryTerm`
|`number` - only perform the index operation if the last operation that has changed the document has the specified primary term

|`pipeline`
|`string` - The pipeline id to preprocess incoming documents with

|`body`
|`object` - The document

|===

=== indices.analyze
[source,ts]
----
client.indices.analyze({
  index: string,
  index: string,
  body: object
})
----
link:{ref}/indices-analyze.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index to scope the operation

|`index`
|`string` - The name of the index to scope the operation

|`body`
|`object` - Define analyzer/tokenizer parameters and the text on which the analysis should be performed

|===

=== indices.clearCache
[source,ts]
----
client.indices.clearCache({
  index: string | string[],
  field_data: boolean,
  fielddata: boolean,
  fields: string | string[],
  query: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  index: string | string[],
  request_cache: boolean,
  request: boolean
})
----
link:{ref}/indices-clearcache.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index name to limit the operation

|`field_data` or `fieldData`
|`boolean` - Clear field data. This is deprecated. Prefer `fielddata`.

|`fielddata`
|`boolean` - Clear field data

|`fields`
|`string \| string[]` - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)

|`query`
|`boolean` - Clear query caches

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`index`
|`string \| string[]` - A comma-separated list of index name to limit the operation

|`request_cache` or `requestCache`
|`boolean` - Clear request cache

|`request`
|`boolean` - Clear request cache

|===

=== indices.close
[source,ts]
----
client.indices.close({
  index: string | string[],
  timeout: string,
  master_timeout: string,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/indices-open-close.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma separated list of indices to close

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|===

=== indices.create
[source,ts]
----
client.indices.create({
  index: string,
  include_type_name: boolean,
  wait_for_active_shards: string,
  timeout: string,
  master_timeout: string,
  update_all_types: boolean,
  body: object
})
----
link:{ref}/indices-create-index.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index

|`include_type_name` or `includeTypeName`
|`boolean` - Whether a type should be expected in the body of the mappings.

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Set the number of active shards to wait for before the operation returns.

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`update_all_types` or `updateAllTypes`
|`boolean` - Whether to update the mapping for all fields with the same name across all types or not

|`body`
|`object` - The configuration for the index (`settings` and `mappings`)

|===

=== indices.delete
[source,ts]
----
client.indices.delete({
  index: string | string[],
  timeout: string,
  master_timeout: string,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/indices-delete-index.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Ignore unavailable indexes (default: false)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) +
_Default:_ `open`

|===

=== indices.deleteAlias
[source,ts]
----
client.indices.deleteAlias({
  index: string | string[],
  name: string | string[],
  timeout: string,
  master_timeout: string
})
----
link:{ref}/indices-aliases.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names (supports wildcards); use `_all` for all indices

|`name`
|`string \| string[]` - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.

|`timeout`
|`string` - Explicit timestamp for the document

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|===

=== indices.deleteTemplate
[source,ts]
----
client.indices.deleteTemplate({
  name: string,
  timeout: string,
  master_timeout: string
})
----
link:{ref}/indices-templates.html[Reference]
[cols=2*]
|===
|`name`
|`string` - The name of the template

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|===

=== indices.exists
[source,ts]
----
client.indices.exists({
  index: string | string[],
  local: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  flat_settings: boolean,
  include_defaults: boolean
})
----
link:{ref}/indices-exists.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Ignore unavailable indexes (default: false)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) +
_Default:_ `open`

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`include_defaults` or `includeDefaults`
|`boolean` - Whether to return all default setting for each of the indices.

|===

=== indices.existsAlias
[source,ts]
----
client.indices.existsAlias({
  index: string | string[],
  name: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  local: boolean
})
----
link:{ref}/indices-aliases.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to filter aliases

|`name`
|`string \| string[]` - A comma-separated list of alias names to return

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `all`

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== indices.existsTemplate
[source,ts]
----
client.indices.existsTemplate({
  name: string | string[],
  flat_settings: boolean,
  master_timeout: string,
  local: boolean
})
----
link:{ref}/indices-templates.html[Reference]
[cols=2*]
|===
|`name`
|`string \| string[]` - The comma separated names of the index templates

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== indices.existsType
[source,ts]
----
client.indices.existsType({
  index: string | string[],
  type: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  local: boolean
})
----
link:{ref}/indices-types-exists.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` to check the types across all indices

|`type`
|`string \| string[]` - A comma-separated list of document types to check

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== indices.flush
[source,ts]
----
client.indices.flush({
  index: string | string[],
  force: boolean,
  wait_if_ongoing: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/indices-flush.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string for all indices

|`force`
|`boolean` - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)

|`wait_if_ongoing` or `waitIfOngoing`
|`boolean` - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running.

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|===

=== indices.flushSynced
[source,ts]
----
client.indices.flushSynced({
  index: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/indices-synced-flush.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string for all indices

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|===

=== indices.forcemerge
[source,ts]
----
client.indices.forcemerge({
  index: string | string[],
  flush: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  max_num_segments: number,
  only_expunge_deletes: boolean
})
----
link:{ref}/indices-forcemerge.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`flush`
|`boolean` - Specify whether the index should be flushed after performing the operation (default: true)

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`max_num_segments` or `maxNumSegments`
|`number` - The number of segments the index should be merged into (default: dynamic)

|`only_expunge_deletes` or `onlyExpungeDeletes`
|`boolean` - Specify whether the operation should only expunge deleted documents

|===

=== indices.get
[source,ts]
----
client.indices.get({
  index: string | string[],
  include_type_name: boolean,
  local: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  flat_settings: boolean,
  include_defaults: boolean,
  master_timeout: string
})
----
link:{ref}/indices-get-index.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names

|`include_type_name` or `includeTypeName`
|`boolean` - Whether to add the type name to the response (default: true)

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Ignore unavailable indexes (default: false)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) +
_Default:_ `open`

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`include_defaults` or `includeDefaults`
|`boolean` - Whether to return all default setting for each of the indices.

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|===

=== indices.getAlias
[source,ts]
----
client.indices.getAlias({
  index: string | string[],
  name: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  local: boolean
})
----
link:{ref}/indices-aliases.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to filter aliases

|`name`
|`string \| string[]` - A comma-separated list of alias names to return

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `all`

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== indices.getFieldMapping
[source,ts]
----
client.indices.getFieldMapping({
  index: string | string[],
  type: string | string[],
  fields: string | string[],
  include_type_name: boolean,
  include_defaults: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  local: boolean
})
----
link:{ref}/indices-get-field-mapping.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names

|`type`
|`string \| string[]` - A comma-separated list of document types

|`fields`
|`string \| string[]` - A comma-separated list of fields

|`include_type_name` or `includeTypeName`
|`boolean` - Whether a type should be returned in the body of the mappings.

|`include_defaults` or `includeDefaults`
|`boolean` - Whether the default mapping values should be returned as well

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== indices.getMapping
[source,ts]
----
client.indices.getMapping({
  index: string | string[],
  type: string | string[],
  include_type_name: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  master_timeout: string,
  local: boolean
})
----
link:{ref}/indices-get-mapping.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names

|`type`
|`string \| string[]` - A comma-separated list of document types

|`include_type_name` or `includeTypeName`
|`boolean` - Whether to add the type name to the response.

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== indices.getSettings
[source,ts]
----
client.indices.getSettings({
  index: string | string[],
  name: string | string[],
  master_timeout: string,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  flat_settings: boolean,
  local: boolean,
  include_defaults: boolean
})
----
link:{ref}/indices-get-settings.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`name`
|`string \| string[]` - The name of the settings that should be included

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open,closed`

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`include_defaults` or `includeDefaults`
|`boolean` - Whether to return all default setting for each of the indices.

|===

=== indices.getTemplate
[source,ts]
----
client.indices.getTemplate({
  name: string | string[],
  include_type_name: boolean,
  flat_settings: boolean,
  master_timeout: string,
  local: boolean
})
----
link:{ref}/indices-templates.html[Reference]
[cols=2*]
|===
|`name`
|`string \| string[]` - The comma separated names of the index templates

|`include_type_name` or `includeTypeName`
|`boolean` - Whether a type should be returned in the body of the mappings.

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== indices.getUpgrade
[source,ts]
----
client.indices.getUpgrade({
  index: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/indices-upgrade.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|===

=== indices.open
[source,ts]
----
client.indices.open({
  index: string | string[],
  timeout: string,
  master_timeout: string,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  wait_for_active_shards: string
})
----
link:{ref}/indices-open-close.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma separated list of indices to open

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `closed`

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of active shards to wait for before the operation returns.

|===

=== indices.putAlias
[source,ts]
----
client.indices.putAlias({
  index: string | string[],
  name: string,
  timeout: string,
  master_timeout: string,
  body: object
})
----
link:{ref}/indices-aliases.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices.

|`name`
|`string` - The name of the alias to be created or updated

|`timeout`
|`string` - Explicit timestamp for the document

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`body`
|`object` - The settings for the alias, such as `routing` or `filter`

|===

=== indices.putMapping
[source,ts]
----
client.indices.putMapping({
  index: string | string[],
  type: string,
  include_type_name: boolean,
  timeout: string,
  master_timeout: string,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  update_all_types: boolean,
  body: object
})
----
link:{ref}/indices-put-mapping.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices.

|`type`
|`string` - The name of the document type

|`include_type_name` or `includeTypeName`
|`boolean` - Whether a type should be expected in the body of the mappings.

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`update_all_types` or `updateAllTypes`
|`boolean` - Whether to update the mapping for all fields with the same name across all types or not

|`body`
|`object` - The mapping definition

|===

=== indices.putSettings
[source,ts]
----
client.indices.putSettings({
  index: string | string[],
  master_timeout: string,
  timeout: string,
  preserve_existing: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  flat_settings: boolean,
  body: object
})
----
link:{ref}/indices-update-settings.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`timeout`
|`string` - Explicit operation timeout

|`preserve_existing` or `preserveExisting`
|`boolean` - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`body`
|`object` - The index settings to be updated

|===

=== indices.putTemplate
[source,ts]
----
client.indices.putTemplate({
  name: string,
  include_type_name: boolean,
  order: number,
  create: boolean,
  timeout: string,
  master_timeout: string,
  flat_settings: boolean,
  body: object
})
----
link:{ref}/indices-templates.html[Reference]
[cols=2*]
|===
|`name`
|`string` - The name of the template

|`include_type_name` or `includeTypeName`
|`boolean` - Whether a type should be returned in the body of the mappings.

|`order`
|`number` - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)

|`create`
|`boolean` - Whether the index template should only be added if new or can also replace an existing one

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`body`
|`object` - The template definition

|===

=== indices.recovery
[source,ts]
----
client.indices.recovery({
  index: string | string[],
  detailed: boolean,
  active_only: boolean
})
----
link:{ref}/indices-recovery.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`detailed`
|`boolean` - Whether to display detailed information about shard recovery

|`active_only` or `activeOnly`
|`boolean` - Display only those recoveries that are currently on-going

|===

=== indices.refresh
[source,ts]
----
client.indices.refresh({
  index: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/indices-refresh.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|===

=== indices.rollover
[source,ts]
----
client.indices.rollover({
  alias: string,
  new_index: string,
  include_type_name: boolean,
  timeout: string,
  dry_run: boolean,
  master_timeout: string,
  wait_for_active_shards: string,
  body: object
})
----
link:{ref}/indices-rollover-index.html[Reference]
[cols=2*]
|===
|`alias`
|`string` - The name of the alias to rollover

|`new_index` or `newIndex`
|`string` - The name of the rollover index

|`include_type_name` or `includeTypeName`
|`boolean` - Whether a type should be included in the body of the mappings.

|`timeout`
|`string` - Explicit operation timeout

|`dry_run` or `dryRun`
|`boolean` - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Set the number of active shards to wait for on the newly created rollover index before the operation returns.

|`body`
|`object` - The conditions that needs to be met for executing rollover

|===

=== indices.segments
[source,ts]
----
client.indices.segments({
  index: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  verbose: boolean
})
----
link:{ref}/indices-segments.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`verbose`
|`boolean` - Includes detailed memory usage by Lucene.

|===

=== indices.shardStores
[source,ts]
----
client.indices.shardStores({
  index: string | string[],
  status: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/indices-shards-stores.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`status`
|`string \| string[]` - A comma-separated list of statuses used to filter on shards to get store information for

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|===

=== indices.shrink
[source,ts]
----
client.indices.shrink({
  index: string,
  target: string,
  copy_settings: boolean,
  timeout: string,
  master_timeout: string,
  wait_for_active_shards: string,
  body: object
})
----
link:{ref}/indices-shrink-index.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the source index to shrink

|`target`
|`string` - The name of the target index to shrink into

|`copy_settings` or `copySettings`
|`boolean` - whether or not to copy settings from the source index (defaults to false)

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Set the number of active shards to wait for on the shrunken index before the operation returns.

|`body`
|`object` - The configuration for the target index (`settings` and `aliases`)

|===

=== indices.split
[source,ts]
----
client.indices.split({
  index: string,
  target: string,
  copy_settings: boolean,
  timeout: string,
  master_timeout: string,
  wait_for_active_shards: string,
  body: object
})
----
link:{ref}/indices-split-index.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the source index to split

|`target`
|`string` - The name of the target index to split into

|`copy_settings` or `copySettings`
|`boolean` - whether or not to copy settings from the source index (defaults to false)

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Set the number of active shards to wait for on the shrunken index before the operation returns.

|`body`
|`object` - The configuration for the target index (`settings` and `aliases`)

|===

=== indices.stats
[source,ts]
----
client.indices.stats({
  index: string | string[],
  metric: string | string[],
  completion_fields: string | string[],
  fielddata_fields: string | string[],
  fields: string | string[],
  groups: string | string[],
  level: 'cluster' | 'indices' | 'shards',
  types: string | string[],
  include_segment_file_sizes: boolean
})
----
link:{ref}/indices-stats.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`metric`
|`string \| string[]` - Limit the information returned the specific metrics.

|`completion_fields` or `completionFields`
|`string \| string[]` - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)

|`fielddata_fields` or `fielddataFields`
|`string \| string[]` - A comma-separated list of fields for `fielddata` index metric (supports wildcards)

|`fields`
|`string \| string[]` - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)

|`groups`
|`string \| string[]` - A comma-separated list of search groups for `search` index metric

|`level`
|`'cluster' \| 'indices' \| 'shards'` - Return stats aggregated at cluster, index or shard level +
_Default:_ `indices`

|`types`
|`string \| string[]` - A comma-separated list of document types for the `indexing` index metric

|`include_segment_file_sizes` or `includeSegmentFileSizes`
|`boolean` - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)

|===

=== indices.updateAliases
[source,ts]
----
client.indices.updateAliases({
  timeout: string,
  master_timeout: string,
  body: object
})
----
link:{ref}/indices-aliases.html[Reference]
[cols=2*]
|===
|`timeout`
|`string` - Request timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`body`
|`object` - The definition of `actions` to perform

|===

=== indices.upgrade
[source,ts]
----
client.indices.upgrade({
  index: string | string[],
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  ignore_unavailable: boolean,
  wait_for_completion: boolean,
  only_ancient_segments: boolean
})
----
link:{ref}/indices-upgrade.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Specify whether the request should block until the all segments are upgraded (default: false)

|`only_ancient_segments` or `onlyAncientSegments`
|`boolean` - If true, only ancient (an older Lucene major release) segments will be upgraded

|===

=== indices.validateQuery
[source,ts]
----
client.indices.validateQuery({
  index: string | string[],
  type: string | string[],
  explain: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  q: string,
  analyzer: string,
  analyze_wildcard: boolean,
  default_operator: 'AND' | 'OR',
  df: string,
  lenient: boolean,
  rewrite: boolean,
  all_shards: boolean,
  body: object
})
----
link:{ref}/search-validate.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices

|`type`
|`string \| string[]` - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types

|`explain`
|`boolean` - Return detailed information about the error

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`q`
|`string` - Query in the Lucene query string syntax

|`analyzer`
|`string` - The analyzer to use for the query string

|`analyze_wildcard` or `analyzeWildcard`
|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)

|`default_operator` or `defaultOperator`
|`'AND' \| 'OR'` - The default operator for query string query (AND or OR) +
_Default:_ `OR`

|`df`
|`string` - The field to use as default where no field prefix is given in the query string

|`lenient`
|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

|`rewrite`
|`boolean` - Provide a more detailed explanation showing the actual Lucene query that will be executed.

|`all_shards` or `allShards`
|`boolean` - Execute validation on all shards instead of one random shard per index

|`body`
|`object` - The query definition specified with the Query DSL

|===

=== info
[source,ts]
----
client.info()
----
link:http://www.elastic.co/guide/[Reference]


=== ingest.deletePipeline
[source,ts]
----
client.ingest.deletePipeline({
  id: string,
  master_timeout: string,
  timeout: string
})
----
link:{ref}/delete-pipeline-api.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Pipeline ID

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|===

=== ingest.getPipeline
[source,ts]
----
client.ingest.getPipeline({
  id: string,
  master_timeout: string
})
----
link:{ref}/get-pipeline-api.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Comma separated list of pipeline ids. Wildcards supported

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|===

=== ingest.processorGrok
[source,ts]
----
client.ingest.processorGrok()
----
link:{ref}/grok-processor.html#grok-processor-rest-get[Reference]


=== ingest.putPipeline
[source,ts]
----
client.ingest.putPipeline({
  id: string,
  master_timeout: string,
  timeout: string,
  body: object
})
----
link:{ref}/put-pipeline-api.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Pipeline ID

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|`body`
|`object` - The ingest definition

|===

=== ingest.simulate
[source,ts]
----
client.ingest.simulate({
  id: string,
  verbose: boolean,
  body: object
})
----
link:{ref}/simulate-pipeline-api.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Pipeline ID

|`verbose`
|`boolean` - Verbose mode. Display data output for each processor in executed pipeline

|`body`
|`object` - The simulate definition

|===

=== mget
[source,ts]
----
client.mget({
  index: string,
  type: string,
  stored_fields: string | string[],
  preference: string,
  realtime: boolean,
  refresh: boolean,
  routing: string,
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  body: object
})
----
link:{ref}/docs-multi-get.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index

|`type`
|`string` - The type of the document

|`stored_fields` or `storedFields`
|`string \| string[]` - A comma-separated list of stored fields to return in the response

|`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[]` - True or false to return the _source field or not, or a list of fields to return

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`body`
|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.

|===

=== msearch
[source,ts]
----
client.msearch({
  index: string | string[],
  type: string | string[],
  search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch',
  max_concurrent_searches: number,
  typed_keys: boolean,
  pre_filter_shard_size: number,
  max_concurrent_shard_requests: number,
  rest_total_hits_as_int: boolean,
  body: object
})
----
link:{ref}/search-multi-search.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to use as default

|`type`
|`string \| string[]` - A comma-separated list of document types to use as default

|`search_type` or `searchType`
|`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type

|`max_concurrent_searches` or `maxConcurrentSearches`
|`number` - Controls the maximum number of concurrent searches the multi search api will execute

|`typed_keys` or `typedKeys`
|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response

|`pre_filter_shard_size` or `preFilterShardSize`
|`number` - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. +
_Default:_ `128`

|`max_concurrent_shard_requests` or `maxConcurrentShardRequests`
|`number` - The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests +
_Default:_ `The default grows with the number of nodes in the cluster but is at most 256.`

|`rest_total_hits_as_int` or `restTotalHitsAsInt`
|`boolean` - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number

|`body`
|`object` - The request definitions (metadata-search request definition pairs), separated by newlines

|===

=== msearchTemplate
[source,ts]
----
client.msearchTemplate({
  index: string | string[],
  type: string | string[],
  search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch',
  typed_keys: boolean,
  max_concurrent_searches: number,
  rest_total_hits_as_int: boolean,
  body: object
})
----
link:{ref}/search-multi-search.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to use as default

|`type`
|`string \| string[]` - A comma-separated list of document types to use as default

|`search_type` or `searchType`
|`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type

|`typed_keys` or `typedKeys`
|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response

|`max_concurrent_searches` or `maxConcurrentSearches`
|`number` - Controls the maximum number of concurrent searches the multi search api will execute

|`rest_total_hits_as_int` or `restTotalHitsAsInt`
|`boolean` - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number

|`body`
|`object` - The request definitions (metadata-search request definition pairs), separated by newlines

|===

=== mtermvectors
[source,ts]
----
client.mtermvectors({
  index: string,
  type: string,
  ids: string | string[],
  term_statistics: boolean,
  field_statistics: boolean,
  fields: string | string[],
  offsets: boolean,
  positions: boolean,
  payloads: boolean,
  preference: string,
  routing: string,
  parent: string,
  realtime: boolean,
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force',
  body: object
})
----
link:{ref}/docs-multi-termvectors.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The index in which the document resides.

|`type`
|`string` - The type of the document.

|`ids`
|`string \| string[]` - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body

|`term_statistics` or `termStatistics`
|`boolean` - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".

|`field_statistics` or `fieldStatistics`
|`boolean` - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +
_Default:_ `true`

|`fields`
|`string \| string[]` - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs".

|`offsets`
|`boolean` - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +
_Default:_ `true`

|`positions`
|`boolean` - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +
_Default:_ `true`

|`payloads`
|`boolean` - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +
_Default:_ `true`

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs".

|`routing`
|`string` - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs".

|`parent`
|`string` - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs".

|`realtime`
|`boolean` - Specifies if requests are real-time as opposed to near-real-time (default: true).

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|`body`
|`object` - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.

|===

=== nodes.hotThreads
[source,ts]
----
client.nodes.hotThreads({
  node_id: string | string[],
  interval: string,
  snapshots: number,
  threads: number,
  ignore_idle_threads: boolean,
  type: 'cpu' | 'wait' | 'block',
  timeout: string
})
----
link:{ref}/cluster-nodes-hot-threads.html[Reference]
[cols=2*]
|===
|`node_id` or `nodeId`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes

|`interval`
|`string` - The interval for the second sampling of threads

|`snapshots`
|`number` - Number of samples of thread stacktrace (default: 10)

|`threads`
|`number` - Specify the number of threads to provide information for (default: 3)

|`ignore_idle_threads` or `ignoreIdleThreads`
|`boolean` - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)

|`type`
|`'cpu' \| 'wait' \| 'block'` - The type to sample (default: cpu)

|`timeout`
|`string` - Explicit operation timeout

|===

=== nodes.info
[source,ts]
----
client.nodes.info({
  node_id: string | string[],
  metric: string | string[],
  flat_settings: boolean,
  timeout: string
})
----
link:{ref}/cluster-nodes-info.html[Reference]
[cols=2*]
|===
|`node_id` or `nodeId`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes

|`metric`
|`string \| string[]` - A comma-separated list of metrics you wish returned. Leave empty to return all.

|`flat_settings` or `flatSettings`
|`boolean` - Return settings in flat format (default: false)

|`timeout`
|`string` - Explicit operation timeout

|===

=== nodes.reloadSecureSettings
[source,ts]
----
client.nodes.reloadSecureSettings({
  node_id: string | string[],
  timeout: string
})
----
link:{ref}/secure-settings.html#reloadable-secure-settings[Reference]
[cols=2*]
|===
|`node_id` or `nodeId`
|`string \| string[]` - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.

|`timeout`
|`string` - Explicit operation timeout

|===

=== nodes.stats
[source,ts]
----
client.nodes.stats({
  metric: string | string[],
  index_metric: string | string[],
  node_id: string | string[],
  completion_fields: string | string[],
  fielddata_fields: string | string[],
  fields: string | string[],
  groups: boolean,
  level: 'indices' | 'node' | 'shards',
  types: string | string[],
  timeout: string,
  include_segment_file_sizes: boolean
})
----
link:{ref}/cluster-nodes-stats.html[Reference]
[cols=2*]
|===
|`metric`
|`string \| string[]` - Limit the information returned to the specified metrics

|`index_metric` or `indexMetric`
|`string \| string[]` - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.

|`node_id` or `nodeId`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes

|`completion_fields` or `completionFields`
|`string \| string[]` - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)

|`fielddata_fields` or `fielddataFields`
|`string \| string[]` - A comma-separated list of fields for `fielddata` index metric (supports wildcards)

|`fields`
|`string \| string[]` - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)

|`groups`
|`boolean` - A comma-separated list of search groups for `search` index metric

|`level`
|`'indices' \| 'node' \| 'shards'` - Return indices stats aggregated at index, node or shard level +
_Default:_ `node`

|`types`
|`string \| string[]` - A comma-separated list of document types for the `indexing` index metric

|`timeout`
|`string` - Explicit operation timeout

|`include_segment_file_sizes` or `includeSegmentFileSizes`
|`boolean` - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)

|===

=== nodes.usage
[source,ts]
----
client.nodes.usage({
  metric: string | string[],
  node_id: string | string[],
  timeout: string
})
----
link:{ref}/cluster-nodes-usage.html[Reference]
[cols=2*]
|===
|`metric`
|`string \| string[]` - Limit the information returned to the specified metrics

|`node_id` or `nodeId`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes

|`timeout`
|`string` - Explicit operation timeout

|===

=== ping
[source,ts]
----
client.ping()
----
link:http://www.elastic.co/guide/[Reference]


=== putScript
[source,ts]
----
client.putScript({
  id: string,
  context: string,
  timeout: string,
  master_timeout: string,
  context: string,
  body: object
})
----
link:{ref}/modules-scripting.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Script ID

|`context`
|`string` - Script context

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`context`
|`string` - Context name to compile script against

|`body`
|`object` - The document

|===

=== rankEval
[source,ts]
----
client.rankEval({
  index: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  body: object
})
----
link:{ref}/search-rank-eval.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`body`
|`object` - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.

|===

=== reindex
[source,ts]
----
client.reindex({
  refresh: boolean,
  timeout: string,
  wait_for_active_shards: string,
  wait_for_completion: boolean,
  requests_per_second: number,
  slices: number,
  body: object
})
----
link:{ref}/docs-reindex.html[Reference]
[cols=2*]
|===
|`refresh`
|`boolean` - Should the effected indexes be refreshed?

|`timeout`
|`string` - Time each individual bulk request should wait for shards that are unavailable. +
_Default:_ `1m`

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of shard copies that must be active before proceeding with the reindex 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)

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Should the request should block until the reindex is complete. +
_Default:_ `true`

|`requests_per_second` or `requestsPerSecond`
|`number` - The throttle to set on this request in sub-requests per second. -1 means no throttle.

|`slices`
|`number` - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. +
_Default:_ `1`

|`body`
|`object` - The search definition using the Query DSL and the prototype for the index request.

|===

=== reindexRethrottle
[source,ts]
----
client.reindexRethrottle({
  task_id: string,
  requests_per_second: number
})
----
link:{ref}/docs-reindex.html[Reference]
[cols=2*]
|===
|`task_id` or `taskId`
|`string` - The task id to rethrottle

|`requests_per_second` or `requestsPerSecond`
|`number` - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.

|===

=== renderSearchTemplate
[source,ts]
----
client.renderSearchTemplate({
  id: string,
  body: object
})
----
link:{ref}/search-template.html[Reference]
[cols=2*]
|===
|`id`
|`string` - The id of the stored search template

|`body`
|`object` - The search definition template and its params

|===

=== scriptsPainlessExecute
[source,ts]
----
client.scriptsPainlessExecute({
  body: object
})
----
link:https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html[Reference]
[cols=2*]
|===
|`body`
|`object` - The script to execute

|===

=== scroll
[source,ts]
----
client.scroll({
  scroll_id: string,
  scroll: string,
  scroll_id: string,
  rest_total_hits_as_int: boolean,
  body: object
})
----
link:{ref}/search-request-scroll.html[Reference]
[cols=2*]
|===
|`scroll_id` or `scrollId`
|`string` - The scroll ID

|`scroll`
|`string` - Specify how long a consistent view of the index should be maintained for scrolled search

|`scroll_id` or `scrollId`
|`string` - The scroll ID for scrolled search

|`rest_total_hits_as_int` or `restTotalHitsAsInt`
|`boolean` - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number

|`body`
|`object` - The scroll ID if not passed by URL or query parameter.

|===

=== search
[source,ts]
----
client.search({
  index: string | string[],
  type: string | string[],
  analyzer: string,
  analyze_wildcard: boolean,
  default_operator: 'AND' | 'OR',
  df: string,
  explain: boolean,
  stored_fields: string | string[],
  docvalue_fields: string | string[],
  from: number,
  ignore_unavailable: boolean,
  ignore_throttled: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  lenient: boolean,
  preference: string,
  q: string,
  routing: string | string[],
  scroll: string,
  search_type: 'query_then_fetch' | 'dfs_query_then_fetch',
  size: number,
  sort: string | string[],
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  terminate_after: number,
  stats: string | string[],
  suggest_field: string,
  suggest_mode: 'missing' | 'popular' | 'always',
  suggest_size: number,
  suggest_text: string,
  timeout: string,
  track_scores: boolean,
  track_total_hits: boolean,
  allow_partial_search_results: boolean,
  typed_keys: boolean,
  version: boolean,
  seq_no_primary_term: boolean,
  request_cache: boolean,
  batched_reduce_size: number,
  max_concurrent_shard_requests: number,
  pre_filter_shard_size: number,
  rest_total_hits_as_int: boolean,
  body: object
})
----
link:{ref}/search-search.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices

|`type`
|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types

|`analyzer`
|`string` - The analyzer to use for the query string

|`analyze_wildcard` or `analyzeWildcard`
|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)

|`default_operator` or `defaultOperator`
|`'AND' \| 'OR'` - The default operator for query string query (AND or OR) +
_Default:_ `OR`

|`df`
|`string` - The field to use as default where no field prefix is given in the query string

|`explain`
|`boolean` - Specify whether to return detailed information about score computation as part of a hit

|`stored_fields` or `storedFields`
|`string \| string[]` - A comma-separated list of stored fields to return as part of a hit

|`docvalue_fields` or `docvalueFields`
|`string \| string[]` - A comma-separated list of fields to return as the docvalue representation of a field for each hit

|`from`
|`number` - Starting offset (default: 0)

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`ignore_throttled` or `ignoreThrottled`
|`boolean` - Whether specified concrete, expanded or aliased indices should be ignored when throttled

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`lenient`
|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random)

|`q`
|`string` - Query in the Lucene query string syntax

|`routing`
|`string \| string[]` - A comma-separated list of specific routing values

|`scroll`
|`string` - Specify how long a consistent view of the index should be maintained for scrolled search

|`search_type` or `searchType`
|`'query_then_fetch' \| 'dfs_query_then_fetch'` - Search operation type

|`size`
|`number` - Number of hits to return (default: 10)

|`sort`
|`string \| string[]` - A comma-separated list of <field>:<direction> pairs

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

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`terminate_after` or `terminateAfter`
|`number` - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.

|`stats`
|`string \| string[]` - Specific 'tag' of the request for logging and statistical purposes

|`suggest_field` or `suggestField`
|`string` - Specify which field to use for suggestions

|`suggest_mode` or `suggestMode`
|`'missing' \| 'popular' \| 'always'` - Specify suggest mode +
_Default:_ `missing`

|`suggest_size` or `suggestSize`
|`number` - How many suggestions to return in response

|`suggest_text` or `suggestText`
|`string` - The source text for which the suggestions should be returned

|`timeout`
|`string` - Explicit operation timeout

|`track_scores` or `trackScores`
|`boolean` - Whether to calculate and return scores even if they are not used for sorting

|`track_total_hits` or `trackTotalHits`
|`boolean` - Indicate if the number of documents that match the query should be tracked

|`allow_partial_search_results` or `allowPartialSearchResults`
|`boolean` - Indicate if an error should be returned if there is a partial search failure or timeout +
_Default:_ `true`

|`typed_keys` or `typedKeys`
|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response

|`version`
|`boolean` - Specify whether to return document version as part of a hit

|`seq_no_primary_term` or `seqNoPrimaryTerm`
|`boolean` - Specify whether to return sequence number and primary term of the last modification of each hit

|`request_cache` or `requestCache`
|`boolean` - Specify if request cache should be used for this request or not, defaults to index level setting

|`batched_reduce_size` or `batchedReduceSize`
|`number` - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. +
_Default:_ `512`

|`max_concurrent_shard_requests` or `maxConcurrentShardRequests`
|`number` - The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests +
_Default:_ `The default grows with the number of nodes in the cluster but is at most 256.`

|`pre_filter_shard_size` or `preFilterShardSize`
|`number` - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. +
_Default:_ `128`

|`rest_total_hits_as_int` or `restTotalHitsAsInt`
|`boolean` - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number

|`body`
|`object` - The search definition using the Query DSL

|===

=== searchShards
[source,ts]
----
client.searchShards({
  index: string | string[],
  preference: string,
  routing: string,
  local: boolean,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all'
})
----
link:{ref}/search-shards.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random)

|`routing`
|`string` - Specific routing value

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|===

=== searchTemplate
[source,ts]
----
client.searchTemplate({
  index: string | string[],
  type: string | string[],
  ignore_unavailable: boolean,
  ignore_throttled: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  preference: string,
  routing: string | string[],
  scroll: string,
  search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch',
  explain: boolean,
  profile: boolean,
  typed_keys: boolean,
  rest_total_hits_as_int: boolean,
  body: object
})
----
link:{ref}/search-template.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices

|`type`
|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`ignore_throttled` or `ignoreThrottled`
|`boolean` - Whether specified concrete, expanded or aliased indices should be ignored when throttled

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random)

|`routing`
|`string \| string[]` - A comma-separated list of specific routing values

|`scroll`
|`string` - Specify how long a consistent view of the index should be maintained for scrolled search

|`search_type` or `searchType`
|`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type

|`explain`
|`boolean` - Specify whether to return detailed information about score computation as part of a hit

|`profile`
|`boolean` - Specify whether to profile the query execution

|`typed_keys` or `typedKeys`
|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response

|`rest_total_hits_as_int` or `restTotalHitsAsInt`
|`boolean` - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number

|`body`
|`object` - The search definition template and its params

|===

=== snapshot.create
[source,ts]
----
client.snapshot.create({
  repository: string,
  snapshot: string,
  master_timeout: string,
  wait_for_completion: boolean,
  body: object
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string` - A repository name

|`snapshot`
|`string` - A snapshot name

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Should this request wait until the operation has completed before returning

|`body`
|`object` - The snapshot definition

|===

=== snapshot.createRepository
[source,ts]
----
client.snapshot.createRepository({
  repository: string,
  master_timeout: string,
  timeout: string,
  verify: boolean,
  body: object
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string` - A repository name

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|`verify`
|`boolean` - Whether to verify the repository after creation

|`body`
|`object` - The repository definition

|===

=== snapshot.delete
[source,ts]
----
client.snapshot.delete({
  repository: string,
  snapshot: string,
  master_timeout: string
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string` - A repository name

|`snapshot`
|`string` - A snapshot name

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|===

=== snapshot.deleteRepository
[source,ts]
----
client.snapshot.deleteRepository({
  repository: string | string[],
  master_timeout: string,
  timeout: string
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string \| string[]` - A comma-separated list of repository names

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|===

=== snapshot.get
[source,ts]
----
client.snapshot.get({
  repository: string,
  snapshot: string | string[],
  master_timeout: string,
  ignore_unavailable: boolean,
  verbose: boolean
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string` - A repository name

|`snapshot`
|`string \| string[]` - A comma-separated list of snapshot names

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown

|`verbose`
|`boolean` - Whether to show verbose snapshot info or only show the basic info found in the repository index blob

|===

=== snapshot.getRepository
[source,ts]
----
client.snapshot.getRepository({
  repository: string | string[],
  master_timeout: string,
  local: boolean
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string \| string[]` - A comma-separated list of repository names

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== snapshot.restore
[source,ts]
----
client.snapshot.restore({
  repository: string,
  snapshot: string,
  master_timeout: string,
  wait_for_completion: boolean,
  body: object
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string` - A repository name

|`snapshot`
|`string` - A snapshot name

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Should this request wait until the operation has completed before returning

|`body`
|`object` - Details of what to restore

|===

=== snapshot.status
[source,ts]
----
client.snapshot.status({
  repository: string,
  snapshot: string | string[],
  master_timeout: string,
  ignore_unavailable: boolean
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string` - A repository name

|`snapshot`
|`string \| string[]` - A comma-separated list of snapshot names

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown

|===

=== snapshot.verifyRepository
[source,ts]
----
client.snapshot.verifyRepository({
  repository: string,
  master_timeout: string,
  timeout: string
})
----
link:{ref}/modules-snapshots.html[Reference]
[cols=2*]
|===
|`repository`
|`string` - A repository name

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`timeout`
|`string` - Explicit operation timeout

|===

=== tasks.cancel
[source,ts]
----
client.tasks.cancel({
  task_id: string,
  nodes: string | string[],
  actions: string | string[],
  parent_task_id: string
})
----
link:{ref}/tasks.html[Reference]
[cols=2*]
|===
|`task_id` or `taskId`
|`string` - Cancel the task with specified task id (node_id:task_number)

|`nodes`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes

|`actions`
|`string \| string[]` - A comma-separated list of actions that should be cancelled. Leave empty to cancel all.

|`parent_task_id` or `parentTaskId`
|`string` - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.

|===

=== tasks.get
[source,ts]
----
client.tasks.get({
  task_id: string,
  wait_for_completion: boolean,
  timeout: string
})
----
link:{ref}/tasks.html[Reference]
[cols=2*]
|===
|`task_id` or `taskId`
|`string` - Return the task with specified id (node_id:task_number)

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Wait for the matching tasks to complete (default: false)

|`timeout`
|`string` - Explicit operation timeout

|===

=== tasks.list
[source,ts]
----
client.tasks.list({
  nodes: string | string[],
  actions: string | string[],
  detailed: boolean,
  parent_task_id: string,
  wait_for_completion: boolean,
  group_by: 'nodes' | 'parents' | 'none',
  timeout: string
})
----
link:{ref}/tasks.html[Reference]
[cols=2*]
|===
|`nodes`
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes

|`actions`
|`string \| string[]` - A comma-separated list of actions that should be returned. Leave empty to return all.

|`detailed`
|`boolean` - Return detailed task information (default: false)

|`parent_task_id` or `parentTaskId`
|`string` - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Wait for the matching tasks to complete (default: false)

|`group_by` or `groupBy`
|`'nodes' \| 'parents' \| 'none'` - Group tasks by nodes or parent/child relationships +
_Default:_ `nodes`

|`timeout`
|`string` - Explicit operation timeout

|===

=== termvectors
[source,ts]
----
client.termvectors({
  index: string,
  type: string,
  id: string,
  term_statistics: boolean,
  field_statistics: boolean,
  fields: string | string[],
  offsets: boolean,
  positions: boolean,
  payloads: boolean,
  preference: string,
  routing: string,
  parent: string,
  realtime: boolean,
  version: number,
  version_type: 'internal' | 'external' | 'external_gte' | 'force',
  body: object
})
----
link:{ref}/docs-termvectors.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The index in which the document resides.

|`type`
|`string` - The type of the document.

|`id`
|`string` - The id of the document, when not specified a doc param should be supplied.

|`term_statistics` or `termStatistics`
|`boolean` - Specifies if total term frequency and document frequency should be returned.

|`field_statistics` or `fieldStatistics`
|`boolean` - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. +
_Default:_ `true`

|`fields`
|`string \| string[]` - A comma-separated list of fields to return.

|`offsets`
|`boolean` - Specifies if term offsets should be returned. +
_Default:_ `true`

|`positions`
|`boolean` - Specifies if term positions should be returned. +
_Default:_ `true`

|`payloads`
|`boolean` - Specifies if term payloads should be returned. +
_Default:_ `true`

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random).

|`routing`
|`string` - Specific routing value.

|`parent`
|`string` - Parent id of documents.

|`realtime`
|`boolean` - Specifies if request is real-time as opposed to near-real-time (default: true).

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type

|`body`
|`object` - Define parameters and or supply a document to get termvectors for. See documentation.

|===

=== update
[source,ts]
----
client.update({
  id: string,
  index: string,
  type: string,
  wait_for_active_shards: string,
  fields: string | string[],
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  lang: string,
  parent: string,
  refresh: 'true' | 'false' | 'wait_for',
  retry_on_conflict: number,
  routing: string,
  timeout: string,
  if_seq_no: number,
  if_primary_term: number,
  version: number,
  version_type: 'internal' | 'force',
  body: object
})
----
link:{ref}/docs-update.html[Reference]
[cols=2*]
|===
|`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_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`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

|`if_seq_no` or `ifSeqNo`
|`number` - only perform the update operation if the last operation that has changed the document has the specified sequence number

|`if_primary_term` or `ifPrimaryTerm`
|`number` - only perform the update operation if the last operation that has changed the document has the specified primary term

|`version`
|`number` - Explicit version number for concurrency control

|`version_type` or `versionType`
|`'internal' \| 'force'` - Specific version type

|`body`
|`object` - The request definition requires either `script` or partial `doc`

|===

=== updateByQuery
[source,ts]
----
client.updateByQuery({
  index: string | string[],
  type: string | string[],
  analyzer: string,
  analyze_wildcard: boolean,
  default_operator: 'AND' | 'OR',
  df: string,
  from: number,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  conflicts: 'abort' | 'proceed',
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  lenient: boolean,
  pipeline: string,
  preference: string,
  q: string,
  routing: string | string[],
  scroll: string,
  search_type: 'query_then_fetch' | 'dfs_query_then_fetch',
  search_timeout: string,
  size: number,
  sort: string | string[],
  _source: string | string[],
  _source_excludes: string | string[],
  _source_includes: string | string[],
  terminate_after: number,
  stats: string | string[],
  version: boolean,
  version_type: boolean,
  request_cache: boolean,
  refresh: boolean,
  timeout: string,
  wait_for_active_shards: string,
  scroll_size: number,
  wait_for_completion: boolean,
  requests_per_second: number,
  slices: number,
  body: object
})
----
link:{ref}/docs-update-by-query.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices

|`type`
|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types

|`analyzer`
|`string` - The analyzer to use for the query string

|`analyze_wildcard` or `analyzeWildcard`
|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)

|`default_operator` or `defaultOperator`
|`'AND' \| 'OR'` - The default operator for query string query (AND or OR) +
_Default:_ `OR`

|`df`
|`string` - The field to use as default where no field prefix is given in the query string

|`from`
|`number` - Starting offset (default: 0)

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`conflicts`
|`'abort' \| 'proceed'` - What to do when the update by query hits version conflicts? +
_Default:_ `abort`

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`lenient`
|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

|`pipeline`
|`string` - Ingest pipeline to set on index requests made by this action. (default: none)

|`preference`
|`string` - Specify the node or shard the operation should be performed on (default: random)

|`q`
|`string` - Query in the Lucene query string syntax

|`routing`
|`string \| string[]` - A comma-separated list of specific routing values

|`scroll`
|`string` - Specify how long a consistent view of the index should be maintained for scrolled search

|`search_type` or `searchType`
|`'query_then_fetch' \| 'dfs_query_then_fetch'` - Search operation type

|`search_timeout` or `searchTimeout`
|`string` - Explicit timeout for each search request. Defaults to no timeout.

|`size`
|`number` - Number of hits to return (default: 10)

|`sort`
|`string \| string[]` - A comma-separated list of <field>:<direction> pairs

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

|`_source_excludes` or `_sourceExcludes`
|`string \| string[]` - A list of fields to exclude from the returned _source field

|`_source_includes` or `_sourceIncludes`
|`string \| string[]` - A list of fields to extract and return from the _source field

|`terminate_after` or `terminateAfter`
|`number` - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.

|`stats`
|`string \| string[]` - Specific 'tag' of the request for logging and statistical purposes

|`version`
|`boolean` - Specify whether to return document version as part of a hit

|`version_type` or `versionType`
|`boolean` - Should the document increment the version number (internal) on hit or not (reindex)

|`request_cache` or `requestCache`
|`boolean` - Specify if request cache should be used for this request or not, defaults to index level setting

|`refresh`
|`boolean` - Should the effected indexes be refreshed?

|`timeout`
|`string` - Time each individual bulk request should wait for shards that are unavailable. +
_Default:_ `1m`

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of shard copies that must be active before proceeding with the update by query 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)

|`scroll_size` or `scrollSize`
|`number` - Size on the scroll request powering the update by query

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Should the request should block until the update by query operation is complete. +
_Default:_ `true`

|`requests_per_second` or `requestsPerSecond`
|`number` - The throttle to set on this request in sub-requests per second. -1 means no throttle.

|`slices`
|`number` - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. +
_Default:_ `1`

|`body`
|`object` - The search definition using the Query DSL

|===

=== updateByQueryRethrottle
[source,ts]
----
client.updateByQueryRethrottle({
  task_id: string,
  requests_per_second: number
})
----
link:{ref}/docs-update-by-query.html[Reference]
[cols=2*]
|===
|`task_id` or `taskId`
|`string` - The task id to rethrottle

|`requests_per_second` or `requestsPerSecond`
|`number` - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.

|===

=== ccr.deleteAutoFollowPattern
[source,ts]
----
client.ccr.deleteAutoFollowPattern({
  name: string
})
----
link:{ref}/ccr-delete-auto-follow-pattern.html[Reference]
[cols=2*]
|===
|`name`
|`string` - The name of the auto follow pattern.

|===

=== ccr.follow
[source,ts]
----
client.ccr.follow({
  index: string,
  wait_for_active_shards: string,
  body: object
})
----
link:{ref}/ccr-put-follow.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the follower index

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of shard copies that must be active before returning. Defaults to 0. 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) +
_Default:_ `0`

|`body`
|`object` - The name of the leader index and other optional ccr related parameters

|===

=== ccr.followInfo
[source,ts]
----
client.ccr.followInfo({
  index: string | string[]
})
----
link:{ref}/ccr-get-follow-info.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index patterns; use `_all` to perform the operation on all indices

|===

=== ccr.followStats
[source,ts]
----
client.ccr.followStats({
  index: string | string[]
})
----
link:{ref}/ccr-get-follow-stats.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index patterns; use `_all` to perform the operation on all indices

|===

=== ccr.forgetFollower
[source,ts]
----
client.ccr.forgetFollower({
  index: string,
  body: object
})
----
link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Reference]
[cols=2*]
|===
|`index`
|`string` - the name of the leader index for which specified follower retention leases should be removed

|`body`
|`object` - the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index

|===

=== ccr.getAutoFollowPattern
[source,ts]
----
client.ccr.getAutoFollowPattern({
  name: string
})
----
link:{ref}/ccr-get-auto-follow-pattern.html[Reference]
[cols=2*]
|===
|`name`
|`string` - The name of the auto follow pattern.

|===

=== ccr.pauseFollow
[source,ts]
----
client.ccr.pauseFollow({
  index: string
})
----
link:{ref}/ccr-post-pause-follow.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the follower index that should pause following its leader index.

|===

=== ccr.putAutoFollowPattern
[source,ts]
----
client.ccr.putAutoFollowPattern({
  name: string,
  body: object
})
----
link:{ref}/ccr-put-auto-follow-pattern.html[Reference]
[cols=2*]
|===
|`name`
|`string` - The name of the auto follow pattern.

|`body`
|`object` - The specification of the auto follow pattern

|===

=== ccr.resumeFollow
[source,ts]
----
client.ccr.resumeFollow({
  index: string,
  body: object
})
----
link:{ref}/ccr-post-resume-follow.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the follow index to resume following.

|`body`
|`object` - The name of the leader index and other optional ccr related parameters

|===

=== ccr.stats
[source,ts]
----
client.ccr.stats()
----
link:{ref}/ccr-get-stats.html[Reference]


=== ccr.unfollow
[source,ts]
----
client.ccr.unfollow({
  index: string
})
----
link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the follower index that should be turned into a regular index.

|===

=== ilm.deleteLifecycle
[source,ts]
----
client.ilm.deleteLifecycle({
  policy: string
})
----
link:{ref}/ilm-delete-lifecycle.html[Reference]
[cols=2*]
|===
|`policy`
|`string` - The name of the index lifecycle policy

|===

=== ilm.explainLifecycle
[source,ts]
----
client.ilm.explainLifecycle({
  index: string,
  human: boolean
})
----
link:{ref}/ilm-explain-lifecycle.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index to explain

|`human`
|`boolean` - Return data such as dates in a human readable format +
_Default:_ `false`

|===

=== ilm.getLifecycle
[source,ts]
----
client.ilm.getLifecycle({
  policy: string
})
----
link:{ref}/ilm-get-lifecycle.html[Reference]
[cols=2*]
|===
|`policy`
|`string` - The name of the index lifecycle policy

|===

=== ilm.getStatus
[source,ts]
----
client.ilm.getStatus()
----
link:{ref}/ilm-get-status.html[Reference]


=== ilm.moveToStep
[source,ts]
----
client.ilm.moveToStep({
  index: string,
  body: object
})
----
link:{ref}/ilm-move-to-step.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index whose lifecycle step is to change

|`body`
|`object` - The new lifecycle step to move to

|===

=== ilm.putLifecycle
[source,ts]
----
client.ilm.putLifecycle({
  policy: string,
  body: object
})
----
link:{ref}/ilm-put-lifecycle.html[Reference]
[cols=2*]
|===
|`policy`
|`string` - The name of the index lifecycle policy

|`body`
|`object` - The lifecycle policy definition to register

|===

=== ilm.removePolicy
[source,ts]
----
client.ilm.removePolicy({
  index: string
})
----
link:{ref}/ilm-remove-policy.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index to remove policy on

|===

=== ilm.retry
[source,ts]
----
client.ilm.retry({
  index: string
})
----
link:{ref}/ilm-retry-policy.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the indices (comma-separated) whose failed lifecycle step is to be retry

|===

=== ilm.start
[source,ts]
----
client.ilm.start()
----
link:{ref}/ilm-start.html[Reference]


=== ilm.stop
[source,ts]
----
client.ilm.stop()
----
link:{ref}/ilm-stop.html[Reference]


=== indices.freeze
[source,ts]
----
client.indices.freeze({
  index: string,
  timeout: string,
  master_timeout: string,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  wait_for_active_shards: string
})
----
link:{ref}/freeze-index-api.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index to freeze

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `closed`

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of active shards to wait for before the operation returns.

|===

=== indices.unfreeze
[source,ts]
----
client.indices.unfreeze({
  index: string,
  timeout: string,
  master_timeout: string,
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  wait_for_active_shards: string
})
----
link:{ref}/freeze-index-api.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index to unfreeze

|`timeout`
|`string` - Explicit operation timeout

|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for connection to master

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `closed`

|`wait_for_active_shards` or `waitForActiveShards`
|`string` - Sets the number of active shards to wait for before the operation returns.

|===

=== security.createApiKey
[source,ts]
----
client.security.createApiKey({
  refresh: 'true' | 'false' | 'wait_for',
  body: object
})
----
link:{ref}/security-api-create-api-key.html[Reference]
[cols=2*]
|===
|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|`body`
|`object` - The api key request to create an API key

|===

=== security.getApiKey
[source,ts]
----
client.security.getApiKey({
  id: string,
  name: string,
  username: string,
  realm_name: string
})
----
link:{ref}/security-api-get-api-key.html[Reference]
[cols=2*]
|===
|`id`
|`string` - API key id of the API key to be retrieved

|`name`
|`string` - API key name of the API key to be retrieved

|`username`
|`string` - user name of the user who created this API key to be retrieved

|`realm_name` or `realmName`
|`string` - realm name of the user who created this API key to be retrieved

|===

=== security.invalidateApiKey
[source,ts]
----
client.security.invalidateApiKey({
  body: object
})
----
link:{ref}/security-api-invalidate-api-key.html[Reference]
[cols=2*]
|===
|`body`
|`object` - The api key request to invalidate API key(s)

|===

=== xpack.graph.explore
[source,ts]
----
client.xpack.graph.explore({
  index: string | string[],
  type: string | string[],
  routing: string,
  timeout: string,
  body: object
})
----
link:{ref}/graph-explore-api.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices

|`type`
|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types

|`routing`
|`string` - Specific routing value

|`timeout`
|`string` - Explicit operation timeout

|`body`
|`object` - Graph Query DSL

|===

=== xpack.info
[source,ts]
----
client.xpack.info({
  categories: string | string[]
})
----
link:{ref}/info-api.html[Reference]
[cols=2*]
|===
|`categories`
|`string \| string[]` - Comma-separated list of info categories. Can be any of: build, license, features

|===

=== xpack.license.delete
[source,ts]
----
client.xpack.license.delete()
----
link:{ref}/delete-license.html[Reference]


=== xpack.license.get
[source,ts]
----
client.xpack.license.get({
  local: boolean
})
----
link:{ref}/get-license.html[Reference]
[cols=2*]
|===
|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|===

=== xpack.license.getBasicStatus
[source,ts]
----
client.xpack.license.getBasicStatus()
----
link:{ref}/get-basic-status.html[Reference]


=== xpack.license.getTrialStatus
[source,ts]
----
client.xpack.license.getTrialStatus()
----
link:{ref}/get-trial-status.html[Reference]


=== xpack.license.post
[source,ts]
----
client.xpack.license.post({
  acknowledge: boolean,
  body: object
})
----
link:{ref}/update-license.html[Reference]
[cols=2*]
|===
|`acknowledge`
|`boolean` - whether the user has acknowledged acknowledge messages (default: false)

|`body`
|`object` - licenses to be installed

|===

=== xpack.license.postStartBasic
[source,ts]
----
client.xpack.license.postStartBasic({
  acknowledge: boolean
})
----
link:{ref}/start-basic.html[Reference]
[cols=2*]
|===
|`acknowledge`
|`boolean` - whether the user has acknowledged acknowledge messages (default: false)

|===

=== xpack.license.postStartTrial
[source,ts]
----
client.xpack.license.postStartTrial({
  type: string,
  acknowledge: boolean
})
----
link:{ref}/start-trial.html[Reference]
[cols=2*]
|===
|`type`
|`string` - The type of trial license to generate (default: "trial")

|`acknowledge`
|`boolean` - whether the user has acknowledged acknowledge messages (default: false)

|===

=== xpack.migration.deprecations
[source,ts]
----
client.xpack.migration.deprecations({
  index: string
})
----
link:{ref}/migration-api-deprecation.html[Reference]
[cols=2*]
|===
|`index`
|`string` - Index pattern

|===

=== xpack.migration.getAssistance
[source,ts]
----
client.xpack.migration.getAssistance({
  index: string | string[],
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  ignore_unavailable: boolean
})
----
link:{ref}/migration-api-assistance.html[Reference]
[cols=2*]
|===
|`index`
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

|`allow_no_indices` or `allowNoIndices`
|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`

|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)

|===

=== xpack.migration.upgrade
[source,ts]
----
client.xpack.migration.upgrade({
  index: string,
  wait_for_completion: boolean
})
----
link:{ref}/migration-api-upgrade.html[Reference]
[cols=2*]
|===
|`index`
|`string` - The name of the index

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Should the request block until the upgrade operation is completed +
_Default:_ `true`

|===

=== xpack.ml.closeJob
[source,ts]
----
client.xpack.ml.closeJob({
  job_id: string,
  allow_no_jobs: boolean,
  force: boolean,
  timeout: string,
  body: object
})
----
link:{ref}/ml-close-job.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The name of the job to close

|`allow_no_jobs` or `allowNoJobs`
|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)

|`force`
|`boolean` - True if the job should be forcefully closed

|`timeout`
|`string` - Controls the time to wait until a job has closed. Default to 30 minutes

|`body`
|`object` - The URL params optionally sent in the body

|===

=== xpack.ml.deleteCalendar
[source,ts]
----
client.xpack.ml.deleteCalendar({
  calendar_id: string
})
----
[cols=2*]
|===
|`calendar_id` or `calendarId`
|`string` - The ID of the calendar to delete

|===

=== xpack.ml.deleteCalendarEvent
[source,ts]
----
client.xpack.ml.deleteCalendarEvent({
  calendar_id: string,
  event_id: string
})
----
[cols=2*]
|===
|`calendar_id` or `calendarId`
|`string` - The ID of the calendar to modify

|`event_id` or `eventId`
|`string` - The ID of the event to remove from the calendar

|===

=== xpack.ml.deleteCalendarJob
[source,ts]
----
client.xpack.ml.deleteCalendarJob({
  calendar_id: string,
  job_id: string
})
----
[cols=2*]
|===
|`calendar_id` or `calendarId`
|`string` - The ID of the calendar to modify

|`job_id` or `jobId`
|`string` - The ID of the job to remove from the calendar

|===

=== xpack.ml.deleteDatafeed
[source,ts]
----
client.xpack.ml.deleteDatafeed({
  datafeed_id: string,
  force: boolean
})
----
link:{ref}/ml-delete-datafeed.html[Reference]
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeed to delete

|`force`
|`boolean` - True if the datafeed should be forcefully deleted

|===

=== xpack.ml.deleteExpiredData
[source,ts]
----
client.xpack.ml.deleteExpiredData()
----


=== xpack.ml.deleteFilter
[source,ts]
----
client.xpack.ml.deleteFilter({
  filter_id: string
})
----
[cols=2*]
|===
|`filter_id` or `filterId`
|`string` - The ID of the filter to delete

|===

=== xpack.ml.deleteForecast
[source,ts]
----
client.xpack.ml.deleteForecast({
  job_id: string,
  forecast_id: string,
  allow_no_forecasts: boolean,
  timeout: string
})
----
link:{ref}/ml-delete-forecast.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job from which to delete forecasts

|`forecast_id` or `forecastId`
|`string` - The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all`

|`allow_no_forecasts` or `allowNoForecasts`
|`boolean` - Whether to ignore if `_all` matches no forecasts

|`timeout`
|`string` - Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds

|===

=== xpack.ml.deleteJob
[source,ts]
----
client.xpack.ml.deleteJob({
  job_id: string,
  force: boolean,
  wait_for_completion: boolean
})
----
link:{ref}/ml-delete-job.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to delete

|`force`
|`boolean` - True if the job should be forcefully deleted

|`wait_for_completion` or `waitForCompletion`
|`boolean` - Should this request wait until the operation has completed before returning +
_Default:_ `true`

|===

=== xpack.ml.deleteModelSnapshot
[source,ts]
----
client.xpack.ml.deleteModelSnapshot({
  job_id: string,
  snapshot_id: string
})
----
link:{ref}/ml-delete-snapshot.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to fetch

|`snapshot_id` or `snapshotId`
|`string` - The ID of the snapshot to delete

|===

=== xpack.ml.findFileStructure
[source,ts]
----
client.xpack.ml.findFileStructure({
  lines_to_sample: number,
  timeout: string,
  charset: string,
  format: 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text',
  has_header_row: boolean,
  column_names: string | string[],
  delimiter: string,
  quote: string,
  should_trim_fields: boolean,
  grok_pattern: string,
  timestamp_field: string,
  timestamp_format: string,
  explain: boolean,
  body: object
})
----
link:{ref}/ml-find-file-structure.html[Reference]
[cols=2*]
|===
|`lines_to_sample` or `linesToSample`
|`number` - How many lines of the file should be included in the analysis +
_Default:_ `1000`

|`timeout`
|`string` - Timeout after which the analysis will be aborted +
_Default:_ `25s`

|`charset`
|`string` - Optional parameter to specify the character set of the file

|`format`
|`'ndjson' \| 'xml' \| 'delimited' \| 'semi_structured_text'` - Optional parameter to specify the high level file format

|`has_header_row` or `hasHeaderRow`
|`boolean` - Optional parameter to specify whether a delimited file includes the column names in its first row

|`column_names` or `columnNames`
|`string \| string[]` - Optional parameter containing a comma separated list of the column names for a delimited file

|`delimiter`
|`string` - Optional parameter to specify the delimiter character for a delimited file - must be a single character

|`quote`
|`string` - Optional parameter to specify the quote character for a delimited file - must be a single character

|`should_trim_fields` or `shouldTrimFields`
|`boolean` - Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them

|`grok_pattern` or `grokPattern`
|`string` - Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file

|`timestamp_field` or `timestampField`
|`string` - Optional parameter to specify the timestamp field in the file

|`timestamp_format` or `timestampFormat`
|`string` - Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format

|`explain`
|`boolean` - Whether to include a commentary on how the structure was derived

|`body`
|`object` - The contents of the file to be analyzed

|===

=== xpack.ml.flushJob
[source,ts]
----
client.xpack.ml.flushJob({
  job_id: string,
  calc_interim: boolean,
  start: string,
  end: string,
  advance_time: string,
  skip_time: string,
  body: object
})
----
link:{ref}/ml-flush-job.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The name of the job to flush

|`calc_interim` or `calcInterim`
|`boolean` - Calculates interim results for the most recent bucket or all buckets within the latency period

|`start`
|`string` - When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results

|`end`
|`string` - When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results

|`advance_time` or `advanceTime`
|`string` - Advances time to the given value generating results and updating the model for the advanced interval

|`skip_time` or `skipTime`
|`string` - Skips time to the given value without generating results or updating the model for the skipped interval

|`body`
|`object` - Flush parameters

|===

=== xpack.ml.forecast
[source,ts]
----
client.xpack.ml.forecast({
  job_id: string,
  duration: string,
  expires_in: string
})
----
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to forecast for

|`duration`
|`string` - The duration of the forecast

|`expires_in` or `expiresIn`
|`string` - The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity.

|===

=== xpack.ml.getBuckets
[source,ts]
----
client.xpack.ml.getBuckets({
  job_id: string,
  timestamp: string,
  expand: boolean,
  exclude_interim: boolean,
  from: number,
  size: number,
  start: string,
  end: string,
  anomaly_score: number,
  sort: string,
  desc: boolean,
  body: object
})
----
link:{ref}/ml-get-bucket.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - ID of the job to get bucket results from

|`timestamp`
|`string` - The timestamp of the desired single bucket result

|`expand`
|`boolean` - Include anomaly records

|`exclude_interim` or `excludeInterim`
|`boolean` - Exclude interim results

|`from`
|`number` - skips a number of buckets

|`size`
|`number` - specifies a max number of buckets to get

|`start`
|`string` - Start time filter for buckets

|`end`
|`string` - End time filter for buckets

|`anomaly_score` or `anomalyScore`
|`number` - Filter for the most anomalous buckets

|`sort`
|`string` - Sort buckets by a particular field

|`desc`
|`boolean` - Set the sort direction

|`body`
|`object` - Bucket selection details if not provided in URI

|===

=== xpack.ml.getCalendarEvents
[source,ts]
----
client.xpack.ml.getCalendarEvents({
  calendar_id: string,
  job_id: string,
  start: string,
  end: string,
  from: number,
  size: number
})
----
[cols=2*]
|===
|`calendar_id` or `calendarId`
|`string` - The ID of the calendar containing the events

|`job_id` or `jobId`
|`string` - Get events for the job. When this option is used calendar_id must be '_all'

|`start`
|`string` - Get events after this time

|`end`
|`string` - Get events before this time

|`from`
|`number` - Skips a number of events

|`size`
|`number` - Specifies a max number of events to get

|===

=== xpack.ml.getCalendars
[source,ts]
----
client.xpack.ml.getCalendars({
  calendar_id: string,
  from: number,
  size: number
})
----
[cols=2*]
|===
|`calendar_id` or `calendarId`
|`string` - The ID of the calendar to fetch

|`from`
|`number` - skips a number of calendars

|`size`
|`number` - specifies a max number of calendars to get

|===

=== xpack.ml.getCategories
[source,ts]
----
client.xpack.ml.getCategories({
  job_id: string,
  category_id: number,
  from: number,
  size: number,
  body: object
})
----
link:{ref}/ml-get-category.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The name of the job

|`category_id` or `categoryId`
|`number` - The identifier of the category definition of interest

|`from`
|`number` - skips a number of categories

|`size`
|`number` - specifies a max number of categories to get

|`body`
|`object` - Category selection details if not provided in URI

|===

=== xpack.ml.getDatafeedStats
[source,ts]
----
client.xpack.ml.getDatafeedStats({
  datafeed_id: string,
  allow_no_datafeeds: boolean
})
----
link:{ref}/ml-get-datafeed-stats.html[Reference]
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeeds stats to fetch

|`allow_no_datafeeds` or `allowNoDatafeeds`
|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)

|===

=== xpack.ml.getDatafeeds
[source,ts]
----
client.xpack.ml.getDatafeeds({
  datafeed_id: string,
  allow_no_datafeeds: boolean
})
----
link:{ref}/ml-get-datafeed.html[Reference]
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeeds to fetch

|`allow_no_datafeeds` or `allowNoDatafeeds`
|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)

|===

=== xpack.ml.getFilters
[source,ts]
----
client.xpack.ml.getFilters({
  filter_id: string,
  from: number,
  size: number
})
----
[cols=2*]
|===
|`filter_id` or `filterId`
|`string` - The ID of the filter to fetch

|`from`
|`number` - skips a number of filters

|`size`
|`number` - specifies a max number of filters to get

|===

=== xpack.ml.getInfluencers
[source,ts]
----
client.xpack.ml.getInfluencers({
  job_id: string,
  exclude_interim: boolean,
  from: number,
  size: number,
  start: string,
  end: string,
  influencer_score: number,
  sort: string,
  desc: boolean,
  body: object
})
----
link:{ref}/ml-get-influencer.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - undefined

|`exclude_interim` or `excludeInterim`
|`boolean` - Exclude interim results

|`from`
|`number` - skips a number of influencers

|`size`
|`number` - specifies a max number of influencers to get

|`start`
|`string` - start timestamp for the requested influencers

|`end`
|`string` - end timestamp for the requested influencers

|`influencer_score` or `influencerScore`
|`number` - influencer score threshold for the requested influencers

|`sort`
|`string` - sort field for the requested influencers

|`desc`
|`boolean` - whether the results should be sorted in decending order

|`body`
|`object` - Influencer selection criteria

|===

=== xpack.ml.getJobStats
[source,ts]
----
client.xpack.ml.getJobStats({
  job_id: string,
  allow_no_jobs: boolean
})
----
link:{ref}/ml-get-job-stats.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the jobs stats to fetch

|`allow_no_jobs` or `allowNoJobs`
|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)

|===

=== xpack.ml.getJobs
[source,ts]
----
client.xpack.ml.getJobs({
  job_id: string,
  allow_no_jobs: boolean
})
----
link:{ref}/ml-get-job.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the jobs to fetch

|`allow_no_jobs` or `allowNoJobs`
|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)

|===

=== xpack.ml.getModelSnapshots
[source,ts]
----
client.xpack.ml.getModelSnapshots({
  job_id: string,
  snapshot_id: string,
  from: number,
  size: number,
  start: string,
  end: string,
  sort: string,
  desc: boolean,
  body: object
})
----
link:{ref}/ml-get-snapshot.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to fetch

|`snapshot_id` or `snapshotId`
|`string` - The ID of the snapshot to fetch

|`from`
|`number` - Skips a number of documents

|`size`
|`number` - The default number of documents returned in queries as a string.

|`start`
|`string` - The filter 'start' query parameter

|`end`
|`string` - The filter 'end' query parameter

|`sort`
|`string` - Name of the field to sort on

|`desc`
|`boolean` - True if the results should be sorted in descending order

|`body`
|`object` - Model snapshot selection criteria

|===

=== xpack.ml.getOverallBuckets
[source,ts]
----
client.xpack.ml.getOverallBuckets({
  job_id: string,
  top_n: number,
  bucket_span: string,
  overall_score: number,
  exclude_interim: boolean,
  start: string,
  end: string,
  allow_no_jobs: boolean,
  body: object
})
----
link:{ref}/ml-get-overall-buckets.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The job IDs for which to calculate overall bucket results

|`top_n` or `topN`
|`number` - The number of top job bucket scores to be used in the overall_score calculation

|`bucket_span` or `bucketSpan`
|`string` - The span of the overall buckets. Defaults to the longest job bucket_span

|`overall_score` or `overallScore`
|`number` - Returns overall buckets with overall scores higher than this value

|`exclude_interim` or `excludeInterim`
|`boolean` - If true overall buckets that include interim buckets will be excluded

|`start`
|`string` - Returns overall buckets with timestamps after this time

|`end`
|`string` - Returns overall buckets with timestamps earlier than this time

|`allow_no_jobs` or `allowNoJobs`
|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)

|`body`
|`object` - Overall bucket selection details if not provided in URI

|===

=== xpack.ml.getRecords
[source,ts]
----
client.xpack.ml.getRecords({
  job_id: string,
  exclude_interim: boolean,
  from: number,
  size: number,
  start: string,
  end: string,
  record_score: number,
  sort: string,
  desc: boolean,
  body: object
})
----
link:{ref}/ml-get-record.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - undefined

|`exclude_interim` or `excludeInterim`
|`boolean` - Exclude interim results

|`from`
|`number` - skips a number of records

|`size`
|`number` - specifies a max number of records to get

|`start`
|`string` - Start time filter for records

|`end`
|`string` - End time filter for records

|`record_score` or `recordScore`
|`number` - undefined

|`sort`
|`string` - Sort records by a particular field

|`desc`
|`boolean` - Set the sort direction

|`body`
|`object` - Record selection criteria

|===

=== xpack.ml.info
[source,ts]
----
client.xpack.ml.info()
----


=== xpack.ml.openJob
[source,ts]
----
client.xpack.ml.openJob({
  job_id: string,
  ignore_downtime: boolean,
  timeout: string
})
----
link:{ref}/ml-open-job.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to open

|`ignore_downtime` or `ignoreDowntime`
|`boolean` - Controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start

|`timeout`
|`string` - Controls the time to wait until a job has opened. Default to 30 minutes

|===

=== xpack.ml.postCalendarEvents
[source,ts]
----
client.xpack.ml.postCalendarEvents({
  calendar_id: string,
  body: object
})
----
[cols=2*]
|===
|`calendar_id` or `calendarId`
|`string` - The ID of the calendar to modify

|`body`
|`object` - A list of events

|===

=== xpack.ml.postData
[source,ts]
----
client.xpack.ml.postData({
  job_id: string,
  reset_start: string,
  reset_end: string,
  body: object
})
----
link:{ref}/ml-post-data.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The name of the job receiving the data

|`reset_start` or `resetStart`
|`string` - Optional parameter to specify the start of the bucket resetting range

|`reset_end` or `resetEnd`
|`string` - Optional parameter to specify the end of the bucket resetting range

|`body`
|`object` - The data to process

|===

=== xpack.ml.previewDatafeed
[source,ts]
----
client.xpack.ml.previewDatafeed({
  datafeed_id: string
})
----
link:{ref}/ml-preview-datafeed.html[Reference]
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeed to preview

|===

=== xpack.ml.putCalendar
[source,ts]
----
client.xpack.ml.putCalendar({
  calendar_id: string,
  body: object
})
----
[cols=2*]
|===
|`calendar_id` or `calendarId`
|`string` - The ID of the calendar to create

|`body`
|`object` - The calendar details

|===

=== xpack.ml.putCalendarJob
[source,ts]
----
client.xpack.ml.putCalendarJob({
  calendar_id: string,
  job_id: string
})
----
[cols=2*]
|===
|`calendar_id` or `calendarId`
|`string` - The ID of the calendar to modify

|`job_id` or `jobId`
|`string` - The ID of the job to add to the calendar

|===

=== xpack.ml.putDatafeed
[source,ts]
----
client.xpack.ml.putDatafeed({
  datafeed_id: string,
  body: object
})
----
link:{ref}/ml-put-datafeed.html[Reference]
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeed to create

|`body`
|`object` - The datafeed config

|===

=== xpack.ml.putFilter
[source,ts]
----
client.xpack.ml.putFilter({
  filter_id: string,
  body: object
})
----
[cols=2*]
|===
|`filter_id` or `filterId`
|`string` - The ID of the filter to create

|`body`
|`object` - The filter details

|===

=== xpack.ml.putJob
[source,ts]
----
client.xpack.ml.putJob({
  job_id: string,
  body: object
})
----
link:{ref}/ml-put-job.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to create

|`body`
|`object` - The job

|===

=== xpack.ml.revertModelSnapshot
[source,ts]
----
client.xpack.ml.revertModelSnapshot({
  job_id: string,
  snapshot_id: string,
  delete_intervening_results: boolean,
  body: object
})
----
link:{ref}/ml-revert-snapshot.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to fetch

|`snapshot_id` or `snapshotId`
|`string` - The ID of the snapshot to revert to

|`delete_intervening_results` or `deleteInterveningResults`
|`boolean` - Should we reset the results back to the time of the snapshot?

|`body`
|`object` - Reversion options

|===

=== xpack.ml.setUpgradeMode
[source,ts]
----
client.xpack.ml.setUpgradeMode({
  enabled: boolean,
  timeout: string
})
----
link:{ref}/ml-set-upgrade-mode.html[Reference]
[cols=2*]
|===
|`enabled`
|`boolean` - Whether to enable upgrade_mode ML setting or not. Defaults to false.

|`timeout`
|`string` - Controls the time to wait before action times out. Defaults to 30 seconds

|===

=== xpack.ml.startDatafeed
[source,ts]
----
client.xpack.ml.startDatafeed({
  datafeed_id: string,
  start: string,
  end: string,
  timeout: string,
  body: object
})
----
link:{ref}/ml-start-datafeed.html[Reference]
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeed to start

|`start`
|`string` - The start time from where the datafeed should begin

|`end`
|`string` - The end time when the datafeed should stop. When not set, the datafeed continues in real time

|`timeout`
|`string` - Controls the time to wait until a datafeed has started. Default to 20 seconds

|`body`
|`object` - The start datafeed parameters

|===

=== xpack.ml.stopDatafeed
[source,ts]
----
client.xpack.ml.stopDatafeed({
  datafeed_id: string,
  allow_no_datafeeds: boolean,
  force: boolean,
  timeout: string
})
----
link:{ref}/ml-stop-datafeed.html[Reference]
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeed to stop

|`allow_no_datafeeds` or `allowNoDatafeeds`
|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)

|`force`
|`boolean` - True if the datafeed should be forcefully stopped.

|`timeout`
|`string` - Controls the time to wait until a datafeed has stopped. Default to 20 seconds

|===

=== xpack.ml.updateDatafeed
[source,ts]
----
client.xpack.ml.updateDatafeed({
  datafeed_id: string,
  body: object
})
----
link:{ref}/ml-update-datafeed.html[Reference]
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeed to update

|`body`
|`object` - The datafeed update settings

|===

=== xpack.ml.updateFilter
[source,ts]
----
client.xpack.ml.updateFilter({
  filter_id: string,
  body: object
})
----
[cols=2*]
|===
|`filter_id` or `filterId`
|`string` - The ID of the filter to update

|`body`
|`object` - The filter update

|===

=== xpack.ml.updateJob
[source,ts]
----
client.xpack.ml.updateJob({
  job_id: string,
  body: object
})
----
link:{ref}/ml-update-job.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to create

|`body`
|`object` - The job update settings

|===

=== xpack.ml.updateModelSnapshot
[source,ts]
----
client.xpack.ml.updateModelSnapshot({
  job_id: string,
  snapshot_id: string,
  body: object
})
----
link:{ref}/ml-update-snapshot.html[Reference]
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job to fetch

|`snapshot_id` or `snapshotId`
|`string` - The ID of the snapshot to update

|`body`
|`object` - The model snapshot properties to update

|===

=== xpack.ml.validate
[source,ts]
----
client.xpack.ml.validate({
  body: object
})
----
[cols=2*]
|===
|`body`
|`object` - The job config

|===

=== xpack.ml.validateDetector
[source,ts]
----
client.xpack.ml.validateDetector({
  body: object
})
----
[cols=2*]
|===
|`body`
|`object` - The detector

|===

=== xpack.monitoring.bulk
[source,ts]
----
client.xpack.monitoring.bulk({
  type: string,
  system_id: string,
  system_api_version: string,
  interval: string,
  body: object
})
----
link:{ref}/es-monitoring.html[Reference]
[cols=2*]
|===
|`type`
|`string` - Default document type for items which don't provide one

|`system_id` or `systemId`
|`string` - Identifier of the monitored system

|`system_api_version` or `systemApiVersion`
|`string` - API Version of the monitored system

|`interval`
|`string` - Collection interval (e.g., '10s' or '10000ms') of the payload

|`body`
|`object` - The operation definition and data (action-data pairs), separated by newlines

|===

=== xpack.rollup.deleteJob
[source,ts]
----
client.xpack.rollup.deleteJob({
  id: string
})
----
[cols=2*]
|===
|`id`
|`string` - The ID of the job to delete

|===

=== xpack.rollup.getJobs
[source,ts]
----
client.xpack.rollup.getJobs({
  id: string
})
----
[cols=2*]
|===
|`id`
|`string` - The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs

|===

=== xpack.rollup.getRollupCaps
[source,ts]
----
client.xpack.rollup.getRollupCaps({
  id: string
})
----
[cols=2*]
|===
|`id`
|`string` - The ID of the index to check rollup capabilities on, or left blank for all jobs

|===

=== xpack.rollup.getRollupIndexCaps
[source,ts]
----
client.xpack.rollup.getRollupIndexCaps({
  index: string
})
----
[cols=2*]
|===
|`index`
|`string` - The rollup index or index pattern to obtain rollup capabilities from.

|===

=== xpack.rollup.putJob
[source,ts]
----
client.xpack.rollup.putJob({
  id: string,
  body: object
})
----
[cols=2*]
|===
|`id`
|`string` - The ID of the job to create

|`body`
|`object` - The job configuration

|===

=== xpack.rollup.rollupSearch
[source,ts]
----
client.xpack.rollup.rollupSearch({
  index: string,
  type: string,
  typed_keys: boolean,
  body: object
})
----
[cols=2*]
|===
|`index`
|`string` - The index or index-pattern (containing rollup or regular data) that should be searched

|`type`
|`string` - The doc type inside the index

|`typed_keys` or `typedKeys`
|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response

|`body`
|`object` - The search request body

|===

=== xpack.rollup.startJob
[source,ts]
----
client.xpack.rollup.startJob({
  id: string
})
----
[cols=2*]
|===
|`id`
|`string` - The ID of the job to start

|===

=== xpack.rollup.stopJob
[source,ts]
----
client.xpack.rollup.stopJob({
  id: string,
  wait_for_completion: boolean,
  timeout: string
})
----
[cols=2*]
|===
|`id`
|`string` - The ID of the job to stop

|`wait_for_completion` or `waitForCompletion`
|`boolean` - True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false.

|`timeout`
|`string` - Block for (at maximum) the specified duration while waiting for the job to stop.  Defaults to 30s.

|===

=== xpack.security.authenticate
[source,ts]
----
client.xpack.security.authenticate()
----
link:{ref}/security-api-authenticate.html[Reference]


=== xpack.security.changePassword
[source,ts]
----
client.xpack.security.changePassword({
  username: string,
  refresh: 'true' | 'false' | 'wait_for',
  body: object
})
----
link:{ref}/security-api-change-password.html[Reference]
[cols=2*]
|===
|`username`
|`string` - The username of the user to change the password for

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|`body`
|`object` - the new password for the user

|===

=== xpack.security.clearCachedRealms
[source,ts]
----
client.xpack.security.clearCachedRealms({
  realms: string | string[],
  usernames: string | string[]
})
----
link:{ref}/security-api-clear-cache.html[Reference]
[cols=2*]
|===
|`realms`
|`string \| string[]` - Comma-separated list of realms to clear

|`usernames`
|`string \| string[]` - Comma-separated list of usernames to clear from the cache

|===

=== xpack.security.clearCachedRoles
[source,ts]
----
client.xpack.security.clearCachedRoles({
  name: string | string[]
})
----
link:{ref}/security-api-clear-role-cache.html[Reference]
[cols=2*]
|===
|`name`
|`string \| string[]` - Role name

|===

=== xpack.security.deletePrivileges
[source,ts]
----
client.xpack.security.deletePrivileges({
  application: string,
  name: string,
  refresh: 'true' | 'false' | 'wait_for'
})
----
link:TODO[Reference]
[cols=2*]
|===
|`application`
|`string` - Application name

|`name`
|`string` - Privilege name

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|===

=== xpack.security.deleteRole
[source,ts]
----
client.xpack.security.deleteRole({
  name: string,
  refresh: 'true' | 'false' | 'wait_for'
})
----
link:{ref}/security-api-delete-role.html[Reference]
[cols=2*]
|===
|`name`
|`string` - Role name

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|===

=== xpack.security.deleteRoleMapping
[source,ts]
----
client.xpack.security.deleteRoleMapping({
  name: string,
  refresh: 'true' | 'false' | 'wait_for'
})
----
link:{ref}/security-api-delete-role-mapping.html[Reference]
[cols=2*]
|===
|`name`
|`string` - Role-mapping name

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|===

=== xpack.security.deleteUser
[source,ts]
----
client.xpack.security.deleteUser({
  username: string,
  refresh: 'true' | 'false' | 'wait_for'
})
----
link:{ref}/security-api-delete-user.html[Reference]
[cols=2*]
|===
|`username`
|`string` - username

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|===

=== xpack.security.disableUser
[source,ts]
----
client.xpack.security.disableUser({
  username: string,
  refresh: 'true' | 'false' | 'wait_for'
})
----
link:{ref}/security-api-disable-user.html[Reference]
[cols=2*]
|===
|`username`
|`string` - The username of the user to disable

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|===

=== xpack.security.enableUser
[source,ts]
----
client.xpack.security.enableUser({
  username: string,
  refresh: 'true' | 'false' | 'wait_for'
})
----
link:{ref}/security-api-enable-user.html[Reference]
[cols=2*]
|===
|`username`
|`string` - The username of the user to enable

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|===

=== xpack.security.getPrivileges
[source,ts]
----
client.xpack.security.getPrivileges({
  application: string,
  name: string
})
----
link:TODO[Reference]
[cols=2*]
|===
|`application`
|`string` - Application name

|`name`
|`string` - Privilege name

|===

=== xpack.security.getRole
[source,ts]
----
client.xpack.security.getRole({
  name: string
})
----
link:{ref}/security-api-get-role.html[Reference]
[cols=2*]
|===
|`name`
|`string` - Role name

|===

=== xpack.security.getRoleMapping
[source,ts]
----
client.xpack.security.getRoleMapping({
  name: string
})
----
link:{ref}/security-api-get-role-mapping.html[Reference]
[cols=2*]
|===
|`name`
|`string` - Role-Mapping name

|===

=== xpack.security.getToken
[source,ts]
----
client.xpack.security.getToken({
  body: object
})
----
link:{ref}/security-api-get-token.html[Reference]
[cols=2*]
|===
|`body`
|`object` - The token request to get

|===

=== xpack.security.getUser
[source,ts]
----
client.xpack.security.getUser({
  username: string | string[]
})
----
link:{ref}/security-api-get-user.html[Reference]
[cols=2*]
|===
|`username`
|`string \| string[]` - A comma-separated list of usernames

|===

=== xpack.security.getUserPrivileges
[source,ts]
----
client.xpack.security.getUserPrivileges()
----
link:{ref}/security-api-get-privileges.html[Reference]


=== xpack.security.hasPrivileges
[source,ts]
----
client.xpack.security.hasPrivileges({
  user: string,
  body: object
})
----
link:{ref}/security-api-has-privileges.html[Reference]
[cols=2*]
|===
|`user`
|`string` - Username

|`body`
|`object` - The privileges to test

|===

=== xpack.security.invalidateToken
[source,ts]
----
client.xpack.security.invalidateToken({
  body: object
})
----
link:{ref}/security-api-invalidate-token.html[Reference]
[cols=2*]
|===
|`body`
|`object` - The token to invalidate

|===

=== xpack.security.putPrivileges
[source,ts]
----
client.xpack.security.putPrivileges({
  refresh: 'true' | 'false' | 'wait_for',
  body: object
})
----
link:TODO[Reference]
[cols=2*]
|===
|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|`body`
|`object` - The privilege(s) to add

|===

=== xpack.security.putRole
[source,ts]
----
client.xpack.security.putRole({
  name: string,
  refresh: 'true' | 'false' | 'wait_for',
  body: object
})
----
link:{ref}/security-api-put-role.html[Reference]
[cols=2*]
|===
|`name`
|`string` - Role name

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|`body`
|`object` - The role to add

|===

=== xpack.security.putRoleMapping
[source,ts]
----
client.xpack.security.putRoleMapping({
  name: string,
  refresh: 'true' | 'false' | 'wait_for',
  body: object
})
----
link:{ref}/security-api-put-role-mapping.html[Reference]
[cols=2*]
|===
|`name`
|`string` - Role-mapping name

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|`body`
|`object` - The role to add

|===

=== xpack.security.putUser
[source,ts]
----
client.xpack.security.putUser({
  username: string,
  refresh: 'true' | 'false' | 'wait_for',
  body: object
})
----
link:{ref}/security-api-put-user.html[Reference]
[cols=2*]
|===
|`username`
|`string` - The username of the User

|`refresh`
|`'true' \| 'false' \| 'wait_for'` - If `true` (the default) then refresh the affected 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` then do nothing with refreshes.

|`body`
|`object` - The user to add

|===

=== xpack.sql.clearCursor
[source,ts]
----
client.xpack.sql.clearCursor({
  body: object
})
----
link:Clear SQL cursor[Reference]
[cols=2*]
|===
|`body`
|`object` - Specify the cursor value in the `cursor` element to clean the cursor.

|===

=== xpack.sql.query
[source,ts]
----
client.xpack.sql.query({
  format: string,
  body: object
})
----
link:Execute SQL[Reference]
[cols=2*]
|===
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml

|`body`
|`object` - Use the `query` element to start a query. Use the `cursor` element to continue a query.

|===

=== xpack.sql.translate
[source,ts]
----
client.xpack.sql.translate({
  body: object
})
----
link:Translate SQL into Elasticsearch queries[Reference]
[cols=2*]
|===
|`body`
|`object` - Specify the query in the `query` element.

|===

=== xpack.ssl.certificates
[source,ts]
----
client.xpack.ssl.certificates()
----
link:{ref}/security-api-ssl.html[Reference]


=== xpack.usage
[source,ts]
----
client.xpack.usage({
  master_timeout: string
})
----
link:Retrieve information about xpack features usage[Reference]
[cols=2*]
|===
|`master_timeout` or `masterTimeout`
|`string` - Specify timeout for watch write operation

|===

=== xpack.watcher.ackWatch
[source,ts]
----
client.xpack.watcher.ackWatch({
  watch_id: string,
  action_id: string | string[],
  master_timeout: string
})
----
link:{ref}/watcher-api-ack-watch.html[Reference]
[cols=2*]
|===
|`watch_id` or `watchId`
|`string` - Watch ID

|`action_id` or `actionId`
|`string \| string[]` - A comma-separated list of the action ids to be acked

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|===

=== xpack.watcher.activateWatch
[source,ts]
----
client.xpack.watcher.activateWatch({
  watch_id: string,
  master_timeout: string
})
----
link:{ref}/watcher-api-activate-watch.html[Reference]
[cols=2*]
|===
|`watch_id` or `watchId`
|`string` - Watch ID

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|===

=== xpack.watcher.deactivateWatch
[source,ts]
----
client.xpack.watcher.deactivateWatch({
  watch_id: string,
  master_timeout: string
})
----
link:{ref}/watcher-api-deactivate-watch.html[Reference]
[cols=2*]
|===
|`watch_id` or `watchId`
|`string` - Watch ID

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|===

=== xpack.watcher.deleteWatch
[source,ts]
----
client.xpack.watcher.deleteWatch({
  id: string,
  master_timeout: string
})
----
link:{ref}/watcher-api-delete-watch.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Watch ID

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|===

=== xpack.watcher.executeWatch
[source,ts]
----
client.xpack.watcher.executeWatch({
  id: string,
  debug: boolean,
  body: object
})
----
link:{ref}/watcher-api-execute-watch.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Watch ID

|`debug`
|`boolean` - indicates whether the watch should execute in debug mode

|`body`
|`object` - Execution control

|===

=== xpack.watcher.getWatch
[source,ts]
----
client.xpack.watcher.getWatch({
  id: string
})
----
link:{ref}/watcher-api-get-watch.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Watch ID

|===

=== xpack.watcher.putWatch
[source,ts]
----
client.xpack.watcher.putWatch({
  id: string,
  master_timeout: string,
  active: boolean,
  version: number,
  if_seq_no: number,
  if_primary_term: number,
  body: object
})
----
link:{ref}/watcher-api-put-watch.html[Reference]
[cols=2*]
|===
|`id`
|`string` - Watch ID

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

|`active`
|`boolean` - Specify whether the watch is in/active by default

|`version`
|`number` - Explicit version number for concurrency control

|`if_seq_no` or `ifSeqNo`
|`number` - only update the watch if the last operation that has changed the watch has the specified sequence number

|`if_primary_term` or `ifPrimaryTerm`
|`number` - only update the watch if the last operation that has changed the watch has the specified primary term

|`body`
|`object` - The watch

|===

=== xpack.watcher.restart
[source,ts]
----
client.xpack.watcher.restart()
----
link:{ref}/watcher-api-restart.html[Reference]


=== xpack.watcher.start
[source,ts]
----
client.xpack.watcher.start()
----
link:{ref}/watcher-api-start.html[Reference]


=== xpack.watcher.stats
[source,ts]
----
client.xpack.watcher.stats({
  metric: '_all' | 'queued_watches' | 'current_watches' | 'pending_watches',
  metric: '_all' | 'queued_watches' | 'current_watches' | 'pending_watches',
  emit_stacktraces: boolean
})
----
link:{ref}/watcher-api-stats.html[Reference]
[cols=2*]
|===
|`metric`
|`'_all' \| 'queued_watches' \| 'current_watches' \| 'pending_watches'` - Controls what additional stat metrics should be include in the response

|`metric`
|`'_all' \| 'queued_watches' \| 'current_watches' \| 'pending_watches'` - Controls what additional stat metrics should be include in the response

|`emit_stacktraces` or `emitStacktraces`
|`boolean` - Emits stack traces of currently running watches

|===

=== xpack.watcher.stop
[source,ts]
----
client.xpack.watcher.stop()
----
link:{ref}/watcher-api-stop.html[Reference]

