[[api-reference-6-0]]
== 6.0 API


NOTE: At this time, you must opt into the 6.0 API by setting the `apiVersion` config parameter.


[[api-bulk-6-0]]
=== `bulk`

[source,js]
--------
client.bulk([params, [callback]])
--------

Perform many index/delete operations in a single API call.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method.

.Perform three operations in a single request
[source,js]
---------
client.bulk({
  body: [
    // action description
    { index:  { _index: 'myindex', _type: 'mytype', _id: 1 } },
     // the document to index
    { title: 'foo' },
    // action description
    { update: { _index: 'myindex', _type: 'mytype', _id: 2 } },
    // the document to update
    { doc: { title: 'foo' } },
    // action description
    { delete: { _index: 'myindex', _type: 'mytype', _id: 3 } },
    // no document needed for this delete
  ]
}, function (err, resp) {
  // ...
});
---------


*Params*

[horizontal]
`waitForActiveShards`::
<<api-param-type-string,`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`::
<<api-param-type-string,`String`>> -- 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.
Options:::
 * `"true"`
 * `"false"`
 * `"wait_for"`
 * `""`

`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`type`::
<<api-param-type-string,`String`>> -- Default document type for items which don't provide one
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request
`pipeline`::
<<api-param-type-string,`String`>> -- The pipeline id to preprocess incoming documents with
`index`::
<<api-param-type-string,`String`>> -- Default index for items which don't provide one
`body`::
<<api-param-type-object-array,`Object[]`>>, <<api-param-type-json-lines,`JSONLines`>> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-bulk.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-clearscroll-6-0]]
=== `clearScroll`

[source,js]
--------
client.clearScroll([params, [callback]])
--------

Clear the scroll request created by specifying the scroll parameter to search.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`scrollId`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of scroll IDs to clear
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-count-6-0]]
=== `count`

[source,js]
--------
client.count([params, [callback]])
--------

Get the number of documents for the cluster, index, type, or a query.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-count.html[the elasticsearch docs] for more information pertaining to this method.

.Get the number of all documents in the cluster
[source,js]
---------
client.count(function (error, response, status) {
  // check for and handle error
  var count = response.count;
});
---------

.Get the number of documents in an index
[source,js]
---------
client.count({
  index: 'index_name'
}, function (error, response) {
  // ...
});
---------

.Get the number of documents matching a query
[source,js]
---------
client.count({
  index: 'index_name',
  body: {
    query: {
      filtered: {
        filter: {
          terms: {
            foo: ['bar']
          }
        }
      }
    }
  }
}, function (err, response) {
  // ...
});
---------



*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`minScore`::
<<api-param-type-number,`Number`>> -- Include only documents with a specific `_score` value in the result
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`routing`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of specific routing values
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`analyzer`::
<<api-param-type-string,`String`>> -- The analyzer to use for the query string
`analyzeWildcard`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether wildcard and prefix queries should be analyzed (default: false)
`[defaultOperator=OR]`::
<<api-param-type-string,`String`>> -- The default operator for query string query (AND or OR)
Options:::
 * `"AND"`
 * `"OR"`

`df`::
<<api-param-type-string,`String`>> -- The field to use as default where no field prefix is given in the query string
`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`terminateAfter`::
<<api-param-type-number,`Number`>> -- The maximum count for each shard, upon reaching which the query execution will terminate early
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of indices to restrict the results
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of types to restrict the results
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-count.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-create-6-0]]
=== `create`

[source,js]
--------
client.create([params, [callback]])
--------

Adds a typed JSON document in a specific index, making it searchable. If a document with the same `index`, `type`, and `id` already exists, an error will occur.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-index_.html[the elasticsearch docs] for more information pertaining to this method.

.Create a document
[source,js]
---------
client.create({
  index: 'myindex',
  type: 'mytype',
  id: '1',
  body: {
    title: 'Test 1',
    tags: ['y', 'z'],
    published: true,
    published_at: '2013-01-01',
    counter: 1
  }
}, function (error, response) {
  // ...
});
---------


*Params*

[horizontal]
`waitForActiveShards`::
<<api-param-type-string,`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`::
<<api-param-type-string,`String`>> -- ID of the parent document
`refresh`::
<<api-param-type-string,`String`>> -- 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.
Options:::
 * `"true"`
 * `"false"`
 * `"wait_for"`
 * `""`

`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`pipeline`::
<<api-param-type-string,`String`>> -- The pipeline id to preprocess incoming documents with
`id`::
<<api-param-type-string,`String`>> -- Document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-index_.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-delete-6-0]]
=== `delete`

[source,js]
--------
client.delete([params, [callback]])
--------

Delete a typed JSON document from a specific index based on its id.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-delete.html[the elasticsearch docs] for more information pertaining to this method.

.Delete the document `/myindex/mytype/1`
[source,js]
---------
client.delete({
  index: 'myindex',
  type: 'mytype',
  id: '1'
}, function (error, response) {
  // ...
});
---------


*Params*

[horizontal]
`waitForActiveShards`::
<<api-param-type-string,`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`::
<<api-param-type-string,`String`>> -- ID of parent document
`refresh`::
<<api-param-type-string,`String`>> -- 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.
Options:::
 * `"true"`
 * `"false"`
 * `"wait_for"`
 * `""`

`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-delete.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-deletebyquery-6-0]]
=== `deleteByQuery`

[source,js]
--------
client.deleteByQuery([params, [callback]])
--------

Delete documents from one or more indices and one or more types based on a query.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method.

.Deleting documents with a simple query
[source,js]
---------
client.deleteByQuery({
  index: 'myindex',
  q: 'test'
}, function (error, response) {
  // ...
});
---------

.Deleting documents using the Query DSL
[source,js]
---------
client.deleteByQuery({
  index: 'posts',
  body: {
    query: {
      term: { published: false }
    }
  }
}, function (error, response) {
  // ...
});
---------


*Params*

[horizontal]
`analyzer`::
<<api-param-type-string,`String`>> -- The analyzer to use for the query string
`analyzeWildcard`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether wildcard and prefix queries should be analyzed (default: false)
`[defaultOperator=OR]`::
<<api-param-type-string,`String`>> -- The default operator for query string query (AND or OR)
Options:::
 * `"AND"`
 * `"OR"`

`df`::
<<api-param-type-string,`String`>> -- The field to use as default where no field prefix is given in the query string
`from`::
<<api-param-type-number,`Number`>> -- Starting offset (default: 0)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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]`::
<<api-param-type-string,`String`>> -- What to do when the delete-by-query hits version conflicts?
Options:::
 * `"abort"`
 * `"proceed"`

`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`routing`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of specific routing values
`scroll`::
<<api-param-type-duration-string,`DurationString`>> -- Specify how long a consistent view of the index should be maintained for scrolled search
`searchType`::
<<api-param-type-string,`String`>> -- Search operation type
Options:::
 * `"query_then_fetch"`
 * `"dfs_query_then_fetch"`

`searchTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit timeout for each search request. Defaults to no timeout.
`size`::
<<api-param-type-number,`Number`>> -- Number of hits to return (default: 10)
`sort`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of <field>:<direction> pairs
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`terminateAfter`::
<<api-param-type-number,`Number`>> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
`stats`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Specific 'tag' of the request for logging and statistical purposes
`version`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to return document version as part of a hit
`requestCache`::
<<api-param-type-boolean,`Boolean`>> -- Specify if request cache should be used for this request or not, defaults to index level setting
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Should the effected indexes be refreshed?
`[timeout=1m]`::
<<api-param-type-duration-string,`DurationString`>> -- Time each individual bulk request should wait for shards that are unavailable.
`waitForActiveShards`::
<<api-param-type-string,`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)
`scrollSize`::
<<api-param-type-number,`Number`>> -- Size on the scroll request powering the update_by_query
`[waitForCompletion=true]`::
<<api-param-type-boolean,`Boolean`>> -- Should the request should block until the delete-by-query is complete.
`requestsPerSecond`::
<<api-param-type-number,`Number`>> -- The throttle for this request in sub-requests per second. -1 means no throttle.
`[slices=1]`::
<<api-param-type-number,`Number`>> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types to search; leave empty to perform the operation on all types
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-deletescript-6-0]]
=== `deleteScript`

[source,js]
--------
client.deleteScript([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`id`::
<<api-param-type-string,`String`>> -- Script ID
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-scripting.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-exists-6-0]]
=== `exists`

[source,js]
--------
client.exists([params, [callback]])
--------

Returns a boolean indicating whether or not a given document exists.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html[the elasticsearch docs] for more information pertaining to this method.

.Check that the document `/myindex/mytype/1` exist
[source,js]
---------
client.exists({
  index: 'myindex',
  type: 'mytype',
  id: 1
}, function (error, exists) {
  if (exists === true) {
    // ...
  } else {
    // ...
  }
});
---------


*Params*

[horizontal]
`storedFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of stored fields to return in the response
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to perform the operation in realtime or search mode
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the shard containing the document before performing the operation
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document (use `_all` to fetch the first document matching the ID across all types)
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-existssource-6-0]]
=== `existsSource`

[source,js]
--------
client.existsSource([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to perform the operation in realtime or search mode
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the shard containing the document before performing the operation
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document; use `_all` to fetch the first document matching the ID across all types
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-explain-6-0]]
=== `explain`

[source,js]
--------
client.explain([params, [callback]])
--------

Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. Also check out http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html[percolaters].

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-explain.html[the elasticsearch docs] for more information pertaining to this method.

.See how a document is scored against a simple query
[source,js]
---------
client.explain({
  // the document to test
  index: 'myindex',
  type: 'mytype',
  id: '1',

  // the query to score it against
  q: 'field:value'
}, function (error, response) {
  // ...
});
---------

.See how a document is scored against a query written in the Query DSL
[source,js]
---------
client.explain({
  index: 'myindex',
  type: 'mytype',
  id: '1',
  body: {
    query: {
      match: { title: 'test' }
    }
  }
}, function (error, response) {
  // ...
});
---------


*Params*

[horizontal]
`analyzeWildcard`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
`analyzer`::
<<api-param-type-string,`String`>> -- The analyzer for the query string query
`[defaultOperator=OR]`::
<<api-param-type-string,`String`>> -- The default operator for query string query (AND or OR)
Options:::
 * `"AND"`
 * `"OR"`

`df`::
<<api-param-type-string,`String`>> -- The default field for query string query (default: _all)
`storedFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of stored fields to return in the response
`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-explain.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-fieldcaps-6-0]]
=== `fieldCaps`

[source,js]
--------
client.fieldCaps([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-field-caps.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of field names
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-field-caps.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-get-6-0]]
=== `get`

[source,js]
--------
client.get([params, [callback]])
--------

Get a typed JSON document from the index based on its id.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html[the elasticsearch docs] for more information pertaining to this method.

.Get `/myindex/mytype/1`
[source,js]
---------
client.get({
  index: 'myindex',
  type: 'mytype',
  id: 1
}, function (error, response) {
  // ...
});
---------


*Params*

[horizontal]
`storedFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of stored fields to return in the response
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to perform the operation in realtime or search mode
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the shard containing the document before performing the operation
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document (use `_all` to fetch the first document matching the ID across all types)

link:#[back to top]

[[api-getscript-6-0]]
=== `getScript`

[source,js]
--------
client.getScript([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`id`::
<<api-param-type-string,`String`>> -- Script ID

link:#[back to top]

[[api-getsource-6-0]]
=== `getSource`

[source,js]
--------
client.getSource([params, [callback]])
--------

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


Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to perform the operation in realtime or search mode
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the shard containing the document before performing the operation
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document; use `_all` to fetch the first document matching the ID across all types

link:#[back to top]

[[api-index-6-0]]
=== `index`

[source,js]
--------
client.index([params, [callback]])
--------

Stores a typed JSON document in an index, making it searchable. When the `id` param is not set, a unique id will be auto-generated. When you specify an `id` either a new document will be created, or an existing document will be updated. To enforce "put-if-absent" behavior set the `opType` to `"create"` or use the `create()` method.

Optimistic concurrency control is performed, when the `version` argument is specified. By default, no version checks are performed.

By default, the document will be available for `get()` actions immediately, but will only be available for searching after an index refresh (which can happen automatically or manually). See <<api-indices-refresh>>.


Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-index_.html[the elasticsearch docs] for more information pertaining to this method.

.Create or update a document
[source,js]
---------
client.index({
  index: 'myindex',
  type: 'mytype',
  id: '1',
  body: {
    title: 'Test 1',
    tags: ['y', 'z'],
    published: true,
  }
}, function (error, response) {

});
---------


*Params*

[horizontal]
`waitForActiveShards`::
<<api-param-type-string,`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)
`[opType=index]`::
<<api-param-type-string,`String`>> -- Explicit operation type
Options:::
 * `"index"`
 * `"create"`

`parent`::
<<api-param-type-string,`String`>> -- ID of the parent document
`refresh`::
<<api-param-type-string,`String`>> -- 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.
Options:::
 * `"true"`
 * `"false"`
 * `"wait_for"`
 * `""`

`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`pipeline`::
<<api-param-type-string,`String`>> -- The pipeline id to preprocess incoming documents with
`id`::
<<api-param-type-string,`String`>> -- Document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-index_.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-info-6-0]]
=== `info`

[source,js]
--------
client.info([params, [callback]])
--------

Get basic info from the current cluster.

Check the *<<api-conventions>>* and http://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method.

// no examples



[[api-mget-6-0]]
=== `mget`

[source,js]
--------
client.mget([params, [callback]])
--------

Get multiple documents based on an index, type (optional) and ids. The body required by mget can take two forms: an array of document locations, or an array of document ids.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method.

.An array of doc locations. Useful for getting documents from different indices.
[source,js]
---------
client.mget({
  body: {
    docs: [
      { _index: 'indexA', _type: 'typeA', _id: '1' },
      { _index: 'indexB', _type: 'typeB', _id: '1' },
      { _index: 'indexC', _type: 'typeC', _id: '1' }
    ]
  }
}, function(error, response){
  // ...
});
---------

.An array of ids. You must also specify the `index` and `type` that apply to all of the ids.
[source,js]
---------
client.mget({
  index: 'myindex',
  type: 'mytype',
  body: {
    ids: [1, 2, 3]
  }
}, function(error, response){
  // ...
});
---------


*Params*

[horizontal]
`storedFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of stored fields to return in the response
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to perform the operation in realtime or search mode
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the shard containing the document before performing the operation
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-msearch-6-0]]
=== `msearch`

[source,js]
--------
client.msearch([params, [callback]])
--------

Execute several search requests within the same request.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method.

.Perform multiple different searches, the body is made up of meta/data pairs
[source,js]
---------
client.msearch({
  body: [
    // match all query, on all indices and types
    {},
    { query: { match_all: {} } },

    // query_string query, on index/mytype
    { index: 'myindex', type: 'mytype' },
    { query: { query_string: { query: '"Test 1"' } } }
  ]
});
---------



*Params*

[horizontal]
`searchType`::
<<api-param-type-string,`String`>> -- Search operation type
Options:::
 * `"query_then_fetch"`
 * `"query_and_fetch"`
 * `"dfs_query_then_fetch"`
 * `"dfs_query_and_fetch"`

`maxConcurrentSearches`::
<<api-param-type-number,`Number`>> -- Controls the maximum number of concurrent searches the multi search api will execute
`typedKeys`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response
`[preFilterShardSize=128]`::
<<api-param-type-number,`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.
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to use as default
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types to use as default
`body`::
<<api-param-type-object-array,`Object[]`>>, <<api-param-type-json-lines,`JSONLines`>> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-multi-search.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-msearchtemplate-6-0]]
=== `msearchTemplate`

[source,js]
--------
client.msearchTemplate([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`searchType`::
<<api-param-type-string,`String`>> -- Search operation type
Options:::
 * `"query_then_fetch"`
 * `"query_and_fetch"`
 * `"dfs_query_then_fetch"`
 * `"dfs_query_and_fetch"`

`typedKeys`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response
`maxConcurrentSearches`::
<<api-param-type-number,`Number`>> -- Controls the maximum number of concurrent searches the multi search api will execute
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to use as default
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types to use as default
`body`::
<<api-param-type-object-array,`Object[]`>>, <<api-param-type-json-lines,`JSONLines`>> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-multi-search.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-mtermvectors-6-0]]
=== `mtermvectors`

[source,js]
--------
client.mtermvectors([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ids`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
`termStatistics`::
<<api-param-type-boolean,`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".
`[fieldStatistics=true]`::
<<api-param-type-boolean,`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".
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`[offsets=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`[positions=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`[payloads=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`preference`::
<<api-param-type-string,`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`::
<<api-param-type-string,`String`>> -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`parent`::
<<api-param-type-string,`String`>> -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if requests are real-time as opposed to near-real-time (default: true).
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`index`::
<<api-param-type-string,`String`>> -- The index in which the document resides.
`type`::
<<api-param-type-string,`String`>> -- The type of the document.
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-ping-6-0]]
=== `ping`

[source,js]
--------
client.ping([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and http://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method.

// no examples



[[api-putscript-6-0]]
=== `putScript`

[source,js]
--------
client.putScript([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`context`::
<<api-param-type-string,`String`>> -- Script context
`id`::
<<api-param-type-string,`String`>> -- Script ID
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-scripting.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-reindex-6-0]]
=== `reindex`

[source,js]
--------
client.reindex([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Should the effected indexes be refreshed?
`[timeout=1m]`::
<<api-param-type-duration-string,`DurationString`>> -- Time each individual bulk request should wait for shards that are unavailable.
`waitForActiveShards`::
<<api-param-type-string,`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)
`[waitForCompletion=true]`::
<<api-param-type-boolean,`Boolean`>> -- Should the request should block until the reindex is complete.
`requestsPerSecond`::
<<api-param-type-number,`Number`>> -- The throttle to set on this request in sub-requests per second. -1 means no throttle.
`[slices=1]`::
<<api-param-type-number,`Number`>> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-reindex.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-reindexrethrottle-6-0]]
=== `reindexRethrottle`

[source,js]
--------
client.reindexRethrottle([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`requestsPerSecond`::
<<api-param-type-number,`Number`>> -- The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
`taskId`::
<<api-param-type-string,`String`>> -- The task id to rethrottle
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-reindex.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-rendersearchtemplate-6-0]]
=== `renderSearchTemplate`

[source,js]
--------
client.renderSearchTemplate([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-template.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`id`::
<<api-param-type-string,`String`>> -- The id of the stored search template
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-template.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-scroll-6-0]]
=== `scroll`

[source,js]
--------
client.scroll([params, [callback]])
--------

Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method.

.Collect every title in the index that contains the word "test"
[source,js]
---------
var allTitles = [];

// first we do a search, and specify a scroll timeout
client.search({
  index: 'myindex',
  scroll: '30s', // keep the search results "scrollable" for 30 seconds
  source: ['title'], // filter the source to only include the title field
  q: 'title:test'
}, function getMoreUntilDone(error, response) {
  // collect the title from each response
  response.hits.hits.forEach(function (hit) {
    allTitles.push(hit._source.title);
  });

  if (response.hits.total > allTitles.length) {
    // ask elasticsearch for the next set of hits from this search
    client.scroll({
      scrollId: response._scroll_id,
      scroll: '30s'
    }, getMoreUntilDone);
  } else {
    console.log('every "test" title', allTitles);
  }
});
---------



*Params*

[horizontal]
`scroll`::
<<api-param-type-duration-string,`DurationString`>> -- Specify how long a consistent view of the index should be maintained for scrolled search
`scrollId`::
<<api-param-type-string,`String`>> -- The scroll ID
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-search-6-0]]
=== `search`

[source,js]
--------
client.search([params, [callback]])
--------

Return documents matching a query, aggregations/facets, highlighted snippets, suggestions, and more. Write your queries as either http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-uri-request.html[simple query strings] in the `q` parameter, or by specifying a http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html[full request definition] using the http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html[Elasticsearch Query DSL] in the `body` parameter.

TIP: https://github.com/danpaz/bodybuilder[bodybuilder] and https://github.com/sudo-suhas/elastic-builder[elastic-builder] can be used to make building query bodies easier.



Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-search.html[the elasticsearch docs] for more information pertaining to this method.

.Search with a simple query string query
[source,js]
---------
client.search({
  index: 'myindex',
  q: 'title:test'
}, function (error, response) {
  // ...
});
---------

.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash`
[source,js]
---------
client.search({
  index: 'myindex',
  body: {
    query: {
      match: {
        title: 'test'
      }
    },
    facets: {
      tags: {
        terms: {
          field: 'tags'
        }
      }
    }
  }
}, function (error, response) {
  // ...
});
---------


*Params*

[horizontal]
`analyzer`::
<<api-param-type-string,`String`>> -- The analyzer to use for the query string
`analyzeWildcard`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether wildcard and prefix queries should be analyzed (default: false)
`[defaultOperator=OR]`::
<<api-param-type-string,`String`>> -- The default operator for query string query (AND or OR)
Options:::
 * `"AND"`
 * `"OR"`

`df`::
<<api-param-type-string,`String`>> -- The field to use as default where no field prefix is given in the query string
`explain`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to return detailed information about score computation as part of a hit
`storedFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of stored fields to return as part of a hit
`docvalueFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit
`from`::
<<api-param-type-number,`Number`>> -- Starting offset (default: 0)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`routing`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of specific routing values
`scroll`::
<<api-param-type-duration-string,`DurationString`>> -- Specify how long a consistent view of the index should be maintained for scrolled search
`searchType`::
<<api-param-type-string,`String`>> -- Search operation type
Options:::
 * `"query_then_fetch"`
 * `"dfs_query_then_fetch"`

`size`::
<<api-param-type-number,`Number`>> -- Number of hits to return (default: 10)
`sort`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of <field>:<direction> pairs
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`terminateAfter`::
<<api-param-type-number,`Number`>> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
`stats`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Specific 'tag' of the request for logging and statistical purposes
`suggestField`::
<<api-param-type-string,`String`>> -- Specify which field to use for suggestions
`[suggestMode=missing]`::
<<api-param-type-string,`String`>> -- Specify suggest mode
Options:::
 * `"missing"`
 * `"popular"`
 * `"always"`

`suggestSize`::
<<api-param-type-number,`Number`>> -- How many suggestions to return in response
`suggestText`::
<<api-param-type-string,`String`>> -- The source text for which the suggestions should be returned
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`trackScores`::
<<api-param-type-boolean,`Boolean`>> -- Whether to calculate and return scores even if they are not used for sorting
`trackTotalHits`::
<<api-param-type-boolean,`Boolean`>> -- Indicate if the number of documents that match the query should be tracked
`typedKeys`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response
`version`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to return document version as part of a hit
`requestCache`::
<<api-param-type-boolean,`Boolean`>> -- Specify if request cache should be used for this request or not, defaults to index level setting
`[batchedReduceSize=512]`::
<<api-param-type-number,`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.
`[maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.]`::
<<api-param-type-number,`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
`[preFilterShardSize=128]`::
<<api-param-type-number,`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.
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types to search; leave empty to perform the operation on all types
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-search.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-searchshards-6-0]]
=== `searchShards`

[source,js]
--------
client.searchShards([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-shards.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-shards.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-searchtemplate-6-0]]
=== `searchTemplate`

[source,js]
--------
client.searchTemplate([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-template.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`routing`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of specific routing values
`scroll`::
<<api-param-type-duration-string,`DurationString`>> -- Specify how long a consistent view of the index should be maintained for scrolled search
`searchType`::
<<api-param-type-string,`String`>> -- Search operation type
Options:::
 * `"query_then_fetch"`
 * `"query_and_fetch"`
 * `"dfs_query_then_fetch"`
 * `"dfs_query_and_fetch"`

`explain`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to return detailed information about score computation as part of a hit
`profile`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to profile the query execution
`typedKeys`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types to search; leave empty to perform the operation on all types
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-template.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-termvectors-6-0]]
=== `termvectors`

[source,js]
--------
client.termvectors([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`termStatistics`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if total term frequency and document frequency should be returned.
`[fieldStatistics=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return.
`[offsets=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term offsets should be returned.
`[positions=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term positions should be returned.
`[payloads=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term payloads should be returned.
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random).
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value.
`parent`::
<<api-param-type-string,`String`>> -- Parent id of documents.
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if request is real-time as opposed to near-real-time (default: true).
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"external"`
 * `"external_gte"`
 * `"force"`

`index`::
<<api-param-type-string,`String`>> -- The index in which the document resides.
`type`::
<<api-param-type-string,`String`>> -- The type of the document.
`id`::
<<api-param-type-string,`String`>> -- The id of the document, when not specified a doc param should be supplied.
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-update-6-0]]
=== `update`

[source,js]
--------
client.update([params, [callback]])
--------

Update parts of a document. The required body parameter can contain one of two things:

  * a partial document, which will be merged with the existing one.
  * a `script` which will update the document content

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-update.html[the elasticsearch docs] for more information pertaining to this method.

.Update document title using partial document
[source,js]
---------
client.update({
  index: 'myindex',
  type: 'mytype',
  id: '1',
  body: {
    // put the partial document under the `doc` key
    doc: {
      title: 'Updated'
    }
  }
}, function (error, response) {
  // ...
})
---------

.Add a tag to document `tags` property using a `script`
[source,js]
---------
client.update({
  index: 'myindex',
  type: 'mytype',
  id: '1',
  body: {
    script: 'ctx._source.tags += tag',
    params: { tag: 'some new tag' }
  }
}, function (error, response) {
  // ...
});
---------

.Increment a document counter by 1 or initialize it, when the document does not exist
[source,js]
---------
client.update({
  index: 'myindex',
  type: 'mytype',
  id: '777',
  body: {
    script: 'ctx._source.counter += 1',
    upsert: {
      counter: 1
    }
  }
}, function (error, response) {
  // ...
})
---------

.Delete a document if it's tagged “to-delete”
[source,js]
---------
client.update({
  index: 'myindex',
  type: 'mytype',
  id: '1',
  body: {
    script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"',
    params: {
      tag: 'to-delete'
    }
  }
}, function (error, response) {
  // ...
});
---------


*Params*

[horizontal]
`waitForActiveShards`::
<<api-param-type-string,`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`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return in the response
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`lang`::
<<api-param-type-string,`String`>> -- The script language (default: painless)
`parent`::
<<api-param-type-string,`String`>> -- ID of the parent document. Is is only used for routing and when for the upsert request
`refresh`::
<<api-param-type-string,`String`>> -- 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.
Options:::
 * `"true"`
 * `"false"`
 * `"wait_for"`
 * `""`

`retryOnConflict`::
<<api-param-type-number,`Number`>> -- Specify how many times should the operation be retried when a conflict occurs (default: 0)
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
 * `"internal"`
 * `"force"`

`id`::
<<api-param-type-string,`String`>> -- Document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-update.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-updatebyquery-6-0]]
=== `updateByQuery`

[source,js]
--------
client.updateByQuery([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`analyzer`::
<<api-param-type-string,`String`>> -- The analyzer to use for the query string
`analyzeWildcard`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether wildcard and prefix queries should be analyzed (default: false)
`[defaultOperator=OR]`::
<<api-param-type-string,`String`>> -- The default operator for query string query (AND or OR)
Options:::
 * `"AND"`
 * `"OR"`

`df`::
<<api-param-type-string,`String`>> -- The field to use as default where no field prefix is given in the query string
`from`::
<<api-param-type-number,`Number`>> -- Starting offset (default: 0)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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]`::
<<api-param-type-string,`String`>> -- What to do when the update by query hits version conflicts?
Options:::
 * `"abort"`
 * `"proceed"`

`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`pipeline`::
<<api-param-type-string,`String`>> -- Ingest pipeline to set on index requests made by this action. (default: none)
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`routing`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of specific routing values
`scroll`::
<<api-param-type-duration-string,`DurationString`>> -- Specify how long a consistent view of the index should be maintained for scrolled search
`searchType`::
<<api-param-type-string,`String`>> -- Search operation type
Options:::
 * `"query_then_fetch"`
 * `"dfs_query_then_fetch"`

`searchTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit timeout for each search request. Defaults to no timeout.
`size`::
<<api-param-type-number,`Number`>> -- Number of hits to return (default: 10)
`sort`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of <field>:<direction> pairs
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`terminateAfter`::
<<api-param-type-number,`Number`>> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
`stats`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Specific 'tag' of the request for logging and statistical purposes
`version`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to return document version as part of a hit
`versionType`::
<<api-param-type-boolean,`Boolean`>> -- Should the document increment the version number (internal) on hit or not (reindex)
`requestCache`::
<<api-param-type-boolean,`Boolean`>> -- Specify if request cache should be used for this request or not, defaults to index level setting
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Should the effected indexes be refreshed?
`[timeout=1m]`::
<<api-param-type-duration-string,`DurationString`>> -- Time each individual bulk request should wait for shards that are unavailable.
`waitForActiveShards`::
<<api-param-type-string,`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)
`scrollSize`::
<<api-param-type-number,`Number`>> -- Size on the scroll request powering the update_by_query
`[waitForCompletion=true]`::
<<api-param-type-boolean,`Boolean`>> -- Should the request should block until the update by query operation is complete.
`requestsPerSecond`::
<<api-param-type-number,`Number`>> -- The throttle to set on this request in sub-requests per second. -1 means no throttle.
`[slices=1]`::
<<api-param-type-number,`Number`>> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types to search; leave empty to perform the operation on all types
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-cat-aliases-6-0]]
=== `cat.aliases`

[source,js]
--------
client.cat.aliases([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`name`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of alias names to return

link:#[back to top]

[[api-cat-allocation-6-0]]
=== `cat.allocation`

[source,js]
--------
client.cat.allocation([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`bytes`::
<<api-param-type-string,`String`>> -- The unit in which to display byte values
Options:::
 * `"b"`
 * `"k"`
 * `"kb"`
 * `"m"`
 * `"mb"`
 * `"g"`
 * `"gb"`
 * `"t"`
 * `"tb"`
 * `"p"`
 * `"pb"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`nodeId`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of node IDs or names to limit the returned information

link:#[back to top]

[[api-cat-count-6-0]]
=== `cat.count`

[source,js]
--------
client.cat.count([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-count.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to limit the returned information

link:#[back to top]

[[api-cat-fielddata-6-0]]
=== `cat.fielddata`

[source,js]
--------
client.cat.fielddata([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`bytes`::
<<api-param-type-string,`String`>> -- The unit in which to display byte values
Options:::
 * `"b"`
 * `"k"`
 * `"kb"`
 * `"m"`
 * `"mb"`
 * `"g"`
 * `"gb"`
 * `"t"`
 * `"tb"`
 * `"p"`
 * `"pb"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return the fielddata size

link:#[back to top]

[[api-cat-health-6-0]]
=== `cat.health`

[source,js]
--------
client.cat.health([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-health.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`[ts=true]`::
<<api-param-type-boolean,`Boolean`>> -- Set to false to disable timestamping
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers

link:#[back to top]

[[api-cat-help-6-0]]
=== `cat.help`

[source,js]
--------
client.cat.help([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by

link:#[back to top]

[[api-cat-indices-6-0]]
=== `cat.indices`

[source,js]
--------
client.cat.indices([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-indices.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`bytes`::
<<api-param-type-string,`String`>> -- The unit in which to display byte values
Options:::
 * `"b"`
 * `"k"`
 * `"m"`
 * `"g"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`health`::
<<api-param-type-string,`String`>> -- A health status ("green", "yellow", or "red" to filter only indices matching the specified health status
Options:::
 * `"green"`
 * `"yellow"`
 * `"red"`

`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`pri`::
<<api-param-type-boolean,`Boolean`>> -- Set to true to return stats only for primary shards
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to limit the returned information

link:#[back to top]

[[api-cat-master-6-0]]
=== `cat.master`

[source,js]
--------
client.cat.master([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-master.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers

link:#[back to top]

[[api-cat-nodeattrs-6-0]]
=== `cat.nodeattrs`

[source,js]
--------
client.cat.nodeattrs([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers

link:#[back to top]

[[api-cat-nodes-6-0]]
=== `cat.nodes`

[source,js]
--------
client.cat.nodes([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`fullId`::
<<api-param-type-boolean,`Boolean`>> -- Return the full node ID instead of the shortened version (default: false)
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers

link:#[back to top]

[[api-cat-pendingtasks-6-0]]
=== `cat.pendingTasks`

[source,js]
--------
client.cat.pendingTasks([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers

link:#[back to top]

[[api-cat-plugins-6-0]]
=== `cat.plugins`

[source,js]
--------
client.cat.plugins([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers

link:#[back to top]

[[api-cat-recovery-6-0]]
=== `cat.recovery`

[source,js]
--------
client.cat.recovery([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`bytes`::
<<api-param-type-string,`String`>> -- The unit in which to display byte values
Options:::
 * `"b"`
 * `"k"`
 * `"kb"`
 * `"m"`
 * `"mb"`
 * `"g"`
 * `"gb"`
 * `"t"`
 * `"tb"`
 * `"p"`
 * `"pb"`

`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to limit the returned information

link:#[back to top]

[[api-cat-repositories-6-0]]
=== `cat.repositories`

[source,js]
--------
client.cat.repositories([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers

link:#[back to top]

[[api-cat-segments-6-0]]
=== `cat.segments`

[source,js]
--------
client.cat.segments([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-segments.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`bytes`::
<<api-param-type-string,`String`>> -- The unit in which to display byte values
Options:::
 * `"b"`
 * `"k"`
 * `"kb"`
 * `"m"`
 * `"mb"`
 * `"g"`
 * `"gb"`
 * `"t"`
 * `"tb"`
 * `"p"`
 * `"pb"`

`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to limit the returned information

link:#[back to top]

[[api-cat-shards-6-0]]
=== `cat.shards`

[source,js]
--------
client.cat.shards([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-shards.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`bytes`::
<<api-param-type-string,`String`>> -- The unit in which to display byte values
Options:::
 * `"b"`
 * `"k"`
 * `"kb"`
 * `"m"`
 * `"mb"`
 * `"g"`
 * `"gb"`
 * `"t"`
 * `"tb"`
 * `"p"`
 * `"pb"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to limit the returned information

link:#[back to top]

[[api-cat-snapshots-6-0]]
=== `cat.snapshots`

[source,js]
--------
client.cat.snapshots([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Set to true to ignore unavailable snapshots
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`repository`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Name of repository from which to fetch the snapshot information

link:#[back to top]

[[api-cat-tasks-6-0]]
=== `cat.tasks`

[source,js]
--------
client.cat.tasks([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`nodeId`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of actions that should be returned. Leave empty to return all.
`detailed`::
<<api-param-type-boolean,`Boolean`>> -- Return detailed task information (default: false)
`parentNode`::
<<api-param-type-string,`String`>> -- Return tasks with specified parent node.
`parentTask`::
<<api-param-type-number,`Number`>> -- Return tasks with specified parent task id. Set to -1 to return all.
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers

link:#[back to top]

[[api-cat-templates-6-0]]
=== `cat.templates`

[source,js]
--------
client.cat.templates([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-templates.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`name`::
<<api-param-type-string,`String`>> -- A pattern that returned template names must match

link:#[back to top]

[[api-cat-threadpool-6-0]]
=== `cat.threadPool`

[source,js]
--------
client.cat.threadPool([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`format`::
<<api-param-type-string,`String`>> -- a short version of the Accept header, e.g. json, yaml
`size`::
<<api-param-type-string,`String`>> -- The multiplier in which to display values
Options:::
 * `""`
 * `"k"`
 * `"m"`
 * `"g"`
 * `"t"`
 * `"p"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`h`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names to display
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`s`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Comma-separated list of column names or column aliases to sort by
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`threadPoolPatterns`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of regular-expressions to filter the thread pools in the output

link:#[back to top]

[[api-cluster-allocationexplain-6-0]]
=== `cluster.allocationExplain`

[source,js]
--------
client.cluster.allocationExplain([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`includeYesDecisions`::
<<api-param-type-boolean,`Boolean`>> -- Return 'YES' decisions in explanation (default: false)
`includeDiskInfo`::
<<api-param-type-boolean,`Boolean`>> -- Return information about disk usage and shard sizes (default: false)
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-cluster-getsettings-6-0]]
=== `cluster.getSettings`

[source,js]
--------
client.cluster.getSettings([params, [callback]])
--------

Get cluster settings (previously set with `putSettings()`)

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`includeDefaults`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return all default clusters setting.

link:#[back to top]

[[api-cluster-health-6-0]]
=== `cluster.health`

[source,js]
--------
client.cluster.health([params, [callback]])
--------

Get a very simple status on the health of the cluster.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-health.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`[level=cluster]`::
<<api-param-type-string,`String`>> -- Specify the level of detail for returned information
Options:::
 * `"cluster"`
 * `"indices"`
 * `"shards"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`waitForActiveShards`::
<<api-param-type-string,`String`>> -- Wait until the specified number of shards is active
`waitForNodes`::
<<api-param-type-string,`String`>> -- Wait until the specified number of nodes is available
`waitForEvents`::
<<api-param-type-string,`String`>> -- Wait until all currently queued events with the given priority are processed
Options:::
 * `"immediate"`
 * `"urgent"`
 * `"high"`
 * `"normal"`
 * `"low"`
 * `"languid"`

`waitForNoRelocatingShards`::
<<api-param-type-boolean,`Boolean`>> -- Whether to wait until there are no relocating shards in the cluster
`waitForStatus`::
<<api-param-type-string,`String`>> -- Wait until cluster is in a specific state
Options:::
 * `"green"`
 * `"yellow"`
 * `"red"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Limit the information returned to a specific index

link:#[back to top]

[[api-cluster-pendingtasks-6-0]]
=== `cluster.pendingTasks`

[source,js]
--------
client.cluster.pendingTasks([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master

link:#[back to top]

[[api-cluster-putsettings-6-0]]
=== `cluster.putSettings`

[source,js]
--------
client.cluster.putSettings([params, [callback]])
--------

Update cluster wide specific settings.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-cluster-remoteinfo-6-0]]
=== `cluster.remoteInfo`

[source,js]
--------
client.cluster.remoteInfo([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-remote-info.html[the elasticsearch docs] for more information pertaining to this method.

// no examples



[[api-cluster-reroute-6-0]]
=== `cluster.reroute`

[source,js]
--------
client.cluster.reroute([params, [callback]])
--------

Explicitly execute a cluster reroute allocation command including specific commands.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`dryRun`::
<<api-param-type-boolean,`Boolean`>> -- Simulate the operation only and return the resulting state
`explain`::
<<api-param-type-boolean,`Boolean`>> -- Return an explanation of why the commands can or cannot be executed
`retryFailed`::
<<api-param-type-boolean,`Boolean`>> -- Retries allocation of shards that are blocked due to too many subsequent allocation failures
`metric`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Limit the information returned to the specified metrics. Defaults to all but metadata
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-cluster-state-6-0]]
=== `cluster.state`

[source,js]
--------
client.cluster.state([params, [callback]])
--------

Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc).

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-state.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`metric`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Limit the information returned to the specified metrics

link:#[back to top]

[[api-cluster-stats-6-0]]
=== `cluster.stats`

[source,js]
--------
client.cluster.stats([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`nodeId`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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

link:#[back to top]

[[api-indices-analyze-6-0]]
=== `indices.analyze`

[source,js]
--------
client.indices.analyze([params, [callback]])
--------

Perform the analysis process on a text and return the tokens breakdown of the text.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`index`::
<<api-param-type-string,`String`>> -- The name of the index to scope the operation
`preferLocal`::
<<api-param-type-boolean,`Boolean`>> -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true)
`[format=detailed]`::
<<api-param-type-string,`String`>> -- Format of the output
Options:::
 * `"detailed"`
 * `"text"`

`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-analyze.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-clearcache-6-0]]
=== `indices.clearCache`

[source,js]
--------
client.indices.clearCache([params, [callback]])
--------

Clear either all caches or specific cached associated with one ore more indices.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`fieldData`::
<<api-param-type-boolean,`Boolean`>> -- Clear field data
`fielddata`::
<<api-param-type-boolean,`Boolean`>> -- Clear field data
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all)
`query`::
<<api-param-type-boolean,`Boolean`>> -- Clear query caches
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index name to limit the operation
`recycler`::
<<api-param-type-boolean,`Boolean`>> -- Clear the recycler cache
`requestCache`::
<<api-param-type-boolean,`Boolean`>> -- Clear request cache
`request`::
<<api-param-type-boolean,`Boolean`>> -- Clear request cache
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-close-6-0]]
=== `indices.close`

[source,js]
--------
client.indices.close([params, [callback]])
--------

Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations.


Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma separated list of indices to close
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-open-close.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-create-6-0]]
=== `indices.create`

[source,js]
--------
client.indices.create([params, [callback]])
--------

Create an index in Elasticsearch.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`waitForActiveShards`::
<<api-param-type-string,`String`>> -- Set the number of active shards to wait for before the operation returns.
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`updateAllTypes`::
<<api-param-type-boolean,`Boolean`>> -- Whether to update the mapping for all fields with the same name across all types or not
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-create-index.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-delete-6-0]]
=== `indices.delete`

[source,js]
--------
client.indices.delete([params, [callback]])
--------

Delete an index in Elasticsearch

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Ignore unavailable indexes (default: false)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Ignore if a wildcard expression resolves to no concrete indices (default: false)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether wildcard expressions should get expanded to open or closed indices (default: open)
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-deletealias-6-0]]
=== `indices.deleteAlias`

[source,js]
--------
client.indices.deleteAlias([params, [callback]])
--------

Delete a specific alias.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit timestamp for the document
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names (supports wildcards); use `_all` for all indices
`name`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-deletetemplate-6-0]]
=== `indices.deleteTemplate`

[source,js]
--------
client.indices.deleteTemplate([params, [callback]])
--------

Delete an index template by its name.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`name`::
<<api-param-type-string,`String`>> -- The name of the template
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-exists-6-0]]
=== `indices.exists`

[source,js]
--------
client.indices.exists([params, [callback]])
--------

Return a boolean indicating whether given index exists.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-exists.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Ignore unavailable indexes (default: false)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Ignore if a wildcard expression resolves to no concrete indices (default: false)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether wildcard expressions should get expanded to open or closed indices (default: open)
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`includeDefaults`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return all default setting for each of the indices.
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-exists.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-existsalias-6-0]]
=== `indices.existsAlias`

[source,js]
--------
client.indices.existsAlias([params, [callback]])
--------

Return a boolean indicating whether given alias exists.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=all]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to filter aliases
`name`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of alias names to return
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-existstemplate-6-0]]
=== `indices.existsTemplate`

[source,js]
--------
client.indices.existsTemplate([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`name`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- The comma separated names of the index templates
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-existstype-6-0]]
=== `indices.existsType`

[source,js]
--------
client.indices.existsType([params, [callback]])
--------

Check if a type/types exists in an index/indices.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` to check the types across all indices
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types to check
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-flush-6-0]]
=== `indices.flush`

[source,js]
--------
client.indices.flush([params, [callback]])
--------

Explicitly flush one or more indices.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-flush.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`force`::
<<api-param-type-boolean,`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)
`waitIfOngoing`::
<<api-param-type-boolean,`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.
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string for all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-flush.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-flushsynced-6-0]]
=== `indices.flushSynced`

[source,js]
--------
client.indices.flushSynced([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string for all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-forcemerge-6-0]]
=== `indices.forcemerge`

[source,js]
--------
client.indices.forcemerge([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`flush`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the index should be flushed after performing the operation (default: true)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`maxNumSegments`::
<<api-param-type-number,`Number`>> -- The number of segments the index should be merged into (default: dynamic)
`onlyExpungeDeletes`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the operation should only expunge deleted documents
`operationThreading`::
anything -- TODO: ?
`waitForMerge`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the request should block until the merge process is finished (default: true)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-get-6-0]]
=== `indices.get`

[source,js]
--------
client.indices.get([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Ignore unavailable indexes (default: false)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Ignore if a wildcard expression resolves to no concrete indices (default: false)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether wildcard expressions should get expanded to open or closed indices (default: open)
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`includeDefaults`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return all default setting for each of the indices.
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names

link:#[back to top]

[[api-indices-getalias-6-0]]
=== `indices.getAlias`

[source,js]
--------
client.indices.getAlias([params, [callback]])
--------

Retrieve a specified alias.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=all]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to filter aliases
`name`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of alias names to return

link:#[back to top]

[[api-indices-getfieldmapping-6-0]]
=== `indices.getFieldMapping`

[source,js]
--------
client.indices.getFieldMapping([params, [callback]])
--------

Retrieve mapping definition of a specific field.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`includeDefaults`::
<<api-param-type-boolean,`Boolean`>> -- Whether the default mapping values should be returned as well
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields

link:#[back to top]

[[api-indices-getmapping-6-0]]
=== `indices.getMapping`

[source,js]
--------
client.indices.getMapping([params, [callback]])
--------

Retrieve mapping definition of index or index/type.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types

link:#[back to top]

[[api-indices-getsettings-6-0]]
=== `indices.getSettings`

[source,js]
--------
client.indices.getSettings([params, [callback]])
--------

Retrieve settings for one or more (or all) indices.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open,closed]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`includeDefaults`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return all default setting for each of the indices.
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`name`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- The name of the settings that should be included

link:#[back to top]

[[api-indices-gettemplate-6-0]]
=== `indices.getTemplate`

[source,js]
--------
client.indices.getTemplate([params, [callback]])
--------

Retrieve an index template by its name.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`name`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- The comma separated names of the index templates

link:#[back to top]

[[api-indices-getupgrade-6-0]]
=== `indices.getUpgrade`

[source,js]
--------
client.indices.getUpgrade([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

link:#[back to top]

[[api-indices-open-6-0]]
=== `indices.open`

[source,js]
--------
client.indices.open([params, [callback]])
--------

Open a closed index, making it available for search.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=closed]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma separated list of indices to open
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-open-close.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-putalias-6-0]]
=== `indices.putAlias`

[source,js]
--------
client.indices.putAlias([params, [callback]])
--------

Create an alias for a specific index/indices.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit timestamp for the document
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices.
`name`::
<<api-param-type-string,`String`>> -- The name of the alias to be created or updated
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-putmapping-6-0]]
=== `indices.putMapping`

[source,js]
--------
client.indices.putMapping([params, [callback]])
--------

Register specific mapping definition for a specific type.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`updateAllTypes`::
<<api-param-type-boolean,`Boolean`>> -- Whether to update the mapping for all fields with the same name across all types or not
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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`::
<<api-param-type-string,`String`>> -- The name of the document type
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-putsettings-6-0]]
=== `indices.putSettings`

[source,js]
--------
client.indices.putSettings([params, [callback]])
--------

Change specific index level settings in real time.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`preserveExisting`::
<<api-param-type-boolean,`Boolean`>> -- Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-puttemplate-6-0]]
=== `indices.putTemplate`

[source,js]
--------
client.indices.putTemplate([params, [callback]])
--------

Create an index template that will automatically be applied to new indices created.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`order`::
<<api-param-type-number,`Number`>> -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
`create`::
<<api-param-type-boolean,`Boolean`>> -- Whether the index template should only be added if new or can also replace an existing one
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`name`::
<<api-param-type-string,`String`>> -- The name of the template
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-recovery-6-0]]
=== `indices.recovery`

[source,js]
--------
client.indices.recovery([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`detailed`::
<<api-param-type-boolean,`Boolean`>> -- Whether to display detailed information about shard recovery
`activeOnly`::
<<api-param-type-boolean,`Boolean`>> -- Display only those recoveries that are currently on-going
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

link:#[back to top]

[[api-indices-refresh-6-0]]
=== `indices.refresh`

[source,js]
--------
client.indices.refresh([params, [callback]])
--------

Explicitly refresh one or more index, making all operations performed since the last refresh available for search.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-refresh.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-rollover-6-0]]
=== `indices.rollover`

[source,js]
--------
client.indices.rollover([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`dryRun`::
<<api-param-type-boolean,`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
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`waitForActiveShards`::
<<api-param-type-string,`String`>> -- Set the number of active shards to wait for on the newly created rollover index before the operation returns.
`alias`::
<<api-param-type-string,`String`>> -- The name of the alias to rollover
`newIndex`::
<<api-param-type-string,`String`>> -- The name of the rollover index
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-segments-6-0]]
=== `indices.segments`

[source,js]
--------
client.indices.segments([params, [callback]])
--------

Retrieve low level segments information that a Lucene index (shard level) is built with.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-segments.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`operationThreading`::
anything -- TODO: ?
`verbose`::
<<api-param-type-boolean,`Boolean`>> -- Includes detailed memory usage by Lucene.
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

link:#[back to top]

[[api-indices-shardstores-6-0]]
=== `indices.shardStores`

[source,js]
--------
client.indices.shardStores([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`status`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of statuses used to filter on shards to get store information for
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`operationThreading`::
anything -- TODO: ?
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices

link:#[back to top]

[[api-indices-shrink-6-0]]
=== `indices.shrink`

[source,js]
--------
client.indices.shrink([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`waitForActiveShards`::
<<api-param-type-string,`String`>> -- Set the number of active shards to wait for on the shrunken index before the operation returns.
`index`::
<<api-param-type-string,`String`>> -- The name of the source index to shrink
`target`::
<<api-param-type-string,`String`>> -- The name of the target index to shrink into
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-stats-6-0]]
=== `indices.stats`

[source,js]
--------
client.indices.stats([params, [callback]])
--------

Retrieve statistics on different operations happening on an index.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-stats.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`completionFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
`fielddataFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards)
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
`groups`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of search groups for `search` index metric
`[level=indices]`::
<<api-param-type-string,`String`>> -- Return stats aggregated at cluster, index or shard level
Options:::
 * `"cluster"`
 * `"indices"`
 * `"shards"`

`types`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types for the `indexing` index metric
`includeSegmentFileSizes`::
<<api-param-type-boolean,`Boolean`>> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`metric`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Limit the information returned the specific metrics.

link:#[back to top]

[[api-indices-updatealiases-6-0]]
=== `indices.updateAliases`

[source,js]
--------
client.indices.updateAliases([params, [callback]])
--------

Update specified aliases.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method.

.Perform an atomic alias swap, for a rotating index
[source,js]
---------
client.indices.updateAliases({
  body: {
    actions: [
      { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } },
      { add:    { index: 'logstash-2014.05', alias: 'logstash-current' } }
    ]
  }
}).then(function (response) {
  // ...
}, errorHandler);
---------


*Params*

[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Request timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-upgrade-6-0]]
=== `indices.upgrade`

[source,js]
--------
client.indices.upgrade([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`waitForCompletion`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the request should block until the all segments are upgraded (default: false)
`onlyAncientSegments`::
<<api-param-type-boolean,`Boolean`>> -- If true, only ancient (an older Lucene major release) segments will be upgraded
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-indices-validatequery-6-0]]
=== `indices.validateQuery`

[source,js]
--------
client.indices.validateQuery([params, [callback]])
--------

Validate a potentially expensive query without executing it.

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-validate.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`explain`::
<<api-param-type-boolean,`Boolean`>> -- Return detailed information about the error
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`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)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
 * `"open"`
 * `"closed"`
 * `"none"`
 * `"all"`

`operationThreading`::
anything -- TODO: ?
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`analyzer`::
<<api-param-type-string,`String`>> -- The analyzer to use for the query string
`analyzeWildcard`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether wildcard and prefix queries should be analyzed (default: false)
`[defaultOperator=OR]`::
<<api-param-type-string,`String`>> -- The default operator for query string query (AND or OR)
Options:::
 * `"AND"`
 * `"OR"`

`df`::
<<api-param-type-string,`String`>> -- The field to use as default where no field prefix is given in the query string
`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`rewrite`::
<<api-param-type-boolean,`Boolean`>> -- Provide a more detailed explanation showing the actual Lucene query that will be executed.
`allShards`::
<<api-param-type-boolean,`Boolean`>> -- Execute validation on all shards instead of one random shard per index
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-validate.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-ingest-deletepipeline-6-0]]
=== `ingest.deletePipeline`

[source,js]
--------
client.ingest.deletePipeline([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`id`::
<<api-param-type-string,`String`>> -- Pipeline ID
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-ingest-getpipeline-6-0]]
=== `ingest.getPipeline`

[source,js]
--------
client.ingest.getPipeline([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`id`::
<<api-param-type-string,`String`>> -- Comma separated list of pipeline ids. Wildcards supported

link:#[back to top]

[[api-ingest-processorgrok-6-0]]
=== `ingest.processorGrok`

[source,js]
--------
client.ingest.processorGrok([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html[the elasticsearch docs] for more information pertaining to this method.

// no examples



[[api-ingest-putpipeline-6-0]]
=== `ingest.putPipeline`

[source,js]
--------
client.ingest.putPipeline([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`id`::
<<api-param-type-string,`String`>> -- Pipeline ID
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-ingest-simulate-6-0]]
=== `ingest.simulate`

[source,js]
--------
client.ingest.simulate([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`verbose`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display data output for each processor in executed pipeline
`id`::
<<api-param-type-string,`String`>> -- Pipeline ID
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-nodes-hotthreads-6-0]]
=== `nodes.hotThreads`

[source,js]
--------
client.nodes.hotThreads([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`interval`::
<<api-param-type-duration-string,`DurationString`>> -- The interval for the second sampling of threads
`snapshots`::
<<api-param-type-number,`Number`>> -- Number of samples of thread stacktrace (default: 10)
`threads`::
<<api-param-type-number,`Number`>> -- Specify the number of threads to provide information for (default: 3)
`ignoreIdleThreads`::
<<api-param-type-boolean,`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`::
<<api-param-type-string,`String`>> -- The type to sample (default: cpu)
Options:::
 * `"cpu"`
 * `"wait"`
 * `"block"`

`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`nodeId`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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

link:#[back to top]

[[api-nodes-info-6-0]]
=== `nodes.info`

[source,js]
--------
client.nodes.info([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`nodeId`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of metrics you wish returned. Leave empty to return all.

link:#[back to top]

[[api-nodes-stats-6-0]]
=== `nodes.stats`

[source,js]
--------
client.nodes.stats([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`completionFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
`fielddataFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards)
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
`groups`::
<<api-param-type-boolean,`Boolean`>> -- A comma-separated list of search groups for `search` index metric
`[level=node]`::
<<api-param-type-string,`String`>> -- Return indices stats aggregated at index, node or shard level
Options:::
 * `"indices"`
 * `"node"`
 * `"shards"`

`types`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types for the `indexing` index metric
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`includeSegmentFileSizes`::
<<api-param-type-boolean,`Boolean`>> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
`metric`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Limit the information returned to the specified metrics
`indexMetric`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.
`nodeId`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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

link:#[back to top]

[[api-nodes-usage-6-0]]
=== `nodes.usage`

[source,js]
--------
client.nodes.usage([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-nodes-usage.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`metric`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Limit the information returned to the specified metrics
`nodeId`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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

link:#[back to top]

[[api-snapshot-create-6-0]]
=== `snapshot.create`

[source,js]
--------
client.snapshot.create([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`waitForCompletion`::
<<api-param-type-boolean,`Boolean`>> -- Should this request wait until the operation has completed before returning
`repository`::
<<api-param-type-string,`String`>> -- A repository name
`snapshot`::
<<api-param-type-string,`String`>> -- A snapshot name
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-snapshot-createrepository-6-0]]
=== `snapshot.createRepository`

[source,js]
--------
client.snapshot.createRepository([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`verify`::
<<api-param-type-boolean,`Boolean`>> -- Whether to verify the repository after creation
`repository`::
<<api-param-type-string,`String`>> -- A repository name
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-snapshot-delete-6-0]]
=== `snapshot.delete`

[source,js]
--------
client.snapshot.delete([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`repository`::
<<api-param-type-string,`String`>> -- A repository name
`snapshot`::
<<api-param-type-string,`String`>> -- A snapshot name
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-snapshot-deleterepository-6-0]]
=== `snapshot.deleteRepository`

[source,js]
--------
client.snapshot.deleteRepository([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`repository`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of repository names
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-snapshot-get-6-0]]
=== `snapshot.get`

[source,js]
--------
client.snapshot.get([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
`verbose`::
<<api-param-type-boolean,`Boolean`>> -- Whether to show verbose snapshot info or only show the basic info found in the repository index blob
`repository`::
<<api-param-type-string,`String`>> -- A repository name
`snapshot`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of snapshot names

link:#[back to top]

[[api-snapshot-getrepository-6-0]]
=== `snapshot.getRepository`

[source,js]
--------
client.snapshot.getRepository([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`repository`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of repository names

link:#[back to top]

[[api-snapshot-restore-6-0]]
=== `snapshot.restore`

[source,js]
--------
client.snapshot.restore([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`waitForCompletion`::
<<api-param-type-boolean,`Boolean`>> -- Should this request wait until the operation has completed before returning
`repository`::
<<api-param-type-string,`String`>> -- A repository name
`snapshot`::
<<api-param-type-string,`String`>> -- A snapshot name
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-snapshot-status-6-0]]
=== `snapshot.status`

[source,js]
--------
client.snapshot.status([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
`repository`::
<<api-param-type-string,`String`>> -- A repository name
`snapshot`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of snapshot names

link:#[back to top]

[[api-snapshot-verifyrepository-6-0]]
=== `snapshot.verifyRepository`

[source,js]
--------
client.snapshot.verifyRepository([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`repository`::
<<api-param-type-string,`String`>> -- A repository name
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-tasks-cancel-6-0]]
=== `tasks.cancel`

[source,js]
--------
client.tasks.cancel([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`nodes`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all.
`parentNode`::
<<api-param-type-string,`String`>> -- Cancel tasks with specified parent node.
`parentTaskId`::
<<api-param-type-string,`String`>> -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.
`taskId`::
<<api-param-type-string,`String`>> -- Cancel the task with specified task id (node_id:task_number)
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html[the elasticsearch docs] for details about what can be specified here.

link:#[back to top]

[[api-tasks-get-6-0]]
=== `tasks.get`

[source,js]
--------
client.tasks.get([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`waitForCompletion`::
<<api-param-type-boolean,`Boolean`>> -- Wait for the matching tasks to complete (default: false)
`taskId`::
<<api-param-type-string,`String`>> -- Return the task with specified id (node_id:task_number)

link:#[back to top]

[[api-tasks-list-6-0]]
=== `tasks.list`

[source,js]
--------
client.tasks.list([params, [callback]])
--------

// no description

Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html[the elasticsearch docs] for more information pertaining to this method.

// no examples


*Params*

[horizontal]
`nodes`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- 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`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of actions that should be returned. Leave empty to return all.
`detailed`::
<<api-param-type-boolean,`Boolean`>> -- Return detailed task information (default: false)
`parentNode`::
<<api-param-type-string,`String`>> -- Return tasks with specified parent node.
`parentTaskId`::
<<api-param-type-string,`String`>> -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.
`waitForCompletion`::
<<api-param-type-boolean,`Boolean`>> -- Wait for the matching tasks to complete (default: false)
`[groupBy=nodes]`::
<<api-param-type-string,`String`>> -- Group tasks by nodes or parent/child relationships
Options:::
 * `"nodes"`
 * `"parents"`


link:#[back to top]
