Files
elasticsearch-js/docs/api_methods_7_2.asciidoc
2019-09-18 18:31:32 -07:00

5338 lines
209 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[[api-reference-7-2]]
== 7.2 API
NOTE: At this time, you must opt into the 7.2 API by setting the `apiVersion` config parameter.
[[api-bulk-7-2]]
=== `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/7.2/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
`_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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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/7.2/docs-bulk.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-clearscroll-7-2]]
=== `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/7.2/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/7.2/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-count-7-2]]
=== `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/7.2/search-count.html[the elasticsearch docs] for more information pertaining to this method.
.Get the number of all documents in the cluster
[source,js]
---------
const { count } = await client.count();
---------
.Get the number of documents in an index
[source,js]
---------
const { count } = await client.count({
index: 'index_name'
});
---------
.Get the number of documents matching a query
[source,js]
---------
const { count } = await client.count({
index: 'index_name',
body: {
query: {
filtered: {
filter: {
terms: {
foo: ['bar']
}
}
}
}
}
});
---------
*Params*
[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`ignoreThrottled`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled
`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/7.2/search-count.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-create-7-2]]
=== `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/7.2/docs-index_.html[the elasticsearch docs] for more information pertaining to this method.
.Create a document
[source,js]
---------
await client.create({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
title: 'Test 1',
tags: ['y', 'z'],
published: true,
published_at: '2013-01-01',
counter: 1
}
});
---------
*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)
`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/7.2/docs-index_.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-delete-7-2]]
=== `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/7.2/docs-delete.html[the elasticsearch docs] for more information pertaining to this method.
.Delete the document `/myindex/mytype/1`
[source,js]
---------
await client.delete({
index: 'myindex',
type: 'mytype',
id: '1'
});
---------
*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)
`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
`ifSeqNo`::
<<api-param-type-number,`Number`>> -- only perform the delete operation if the last operation that has changed the document has the specified sequence number
`ifPrimaryTerm`::
<<api-param-type-number,`Number`>> -- only perform the delete operation if the last operation that has changed the document has the specified primary term
`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/7.2/docs-delete.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-deletebyquery-7-2]]
=== `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/7.2/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method.
.Deleting documents with a simple query
[source,js]
---------
await client.deleteByQuery({
index: 'myindex',
q: 'test'
});
---------
.Deleting documents using the Query DSL
[source,js]
---------
await client.deleteByQuery({
index: 'posts',
body: {
query: {
term: { published: false }
}
}
});
---------
*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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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 delete 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/7.2/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-deletebyqueryrethrottle-7-2]]
=== `deleteByQueryRethrottle`
[source,js]
--------
client.deleteByQueryRethrottle([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/docs-delete-by-query.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/7.2/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-deletescript-7-2]]
=== `deleteScript`
[source,js]
--------
client.deleteScript([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/modules-scripting.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-exists-7-2]]
=== `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/7.2/docs-get.html[the elasticsearch docs] for more information pertaining to this method.
.Check that the document `/myindex/mytype/1` exist
[source,js]
---------
const exists = await client.exists({
index: 'myindex',
type: 'mytype',
id: 1
});
---------
*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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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/7.2/docs-get.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-existssource-7-2]]
=== `existsSource`
[source,js]
--------
client.existsSource([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/docs-get.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)
`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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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; deprecated and optional starting with 7.0
`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/7.2/docs-get.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-explain-7-2]]
=== `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.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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]
---------
const response = await client.explain({
// the document to test
index: 'myindex',
type: 'mytype',
id: '1',
// the query to score it against
q: 'field:value'
});
---------
.See how a document is scored against a query written in the Query DSL
[source,js]
---------
const response = await client.explain({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
query: {
match: { title: 'test' }
}
}
});
---------
*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
`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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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/7.2/search-explain.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-fieldcaps-7-2]]
=== `fieldCaps`
[source,js]
--------
client.fieldCaps([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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"`
`includeUnmapped`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether unmapped fields should be included 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; 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/7.2/search-field-caps.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-get-7-2]]
=== `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/7.2/docs-get.html[the elasticsearch docs] for more information pertaining to this method.
.Get `/myindex/mytype/1`
[source,js]
---------
const response = await client.get({
index: 'myindex',
type: 'mytype',
id: 1
});
---------
*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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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-7-2]]
=== `getScript`
[source,js]
--------
client.getScript([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/modules-scripting.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
`id`::
<<api-param-type-string,`String`>> -- Script ID
link:#[back to top]
[[api-getsource-7-2]]
=== `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/7.2/docs-get.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)
`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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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; deprecated and optional starting with 7.0
link:#[back to top]
[[api-index-7-2]]
=== `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/7.2/docs-index_.html[the elasticsearch docs] for more information pertaining to this method.
.Create or update a document
[source,js]
---------
const response = await client.index({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
title: 'Test 1',
tags: ['y', 'z'],
published: true,
}
});
---------
*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"`
`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"`
`ifSeqNo`::
<<api-param-type-number,`Number`>> -- only perform the index operation if the last operation that has changed the document has the specified sequence number
`ifPrimaryTerm`::
<<api-param-type-number,`Number`>> -- only perform the index operation if the last operation that has changed the document has the specified primary term
`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/7.2/docs-index_.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-info-7-2]]
=== `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-7-2]]
=== `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/7.2/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]
---------
const response = await client.mget({
body: {
docs: [
{ _index: 'indexA', _type: 'typeA', _id: '1' },
{ _index: 'indexB', _type: 'typeB', _id: '1' },
{ _index: 'indexC', _type: 'typeC', _id: '1' }
]
}
});
---------
.An array of ids. You must also specify the `index` and `type` that apply to all of the ids.
[source,js]
---------
const response = await client.mget({
index: 'myindex',
type: 'mytype',
body: {
ids: [1, 2, 3]
}
});
---------
*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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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/7.2/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-msearch-7-2]]
=== `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/7.2/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]
---------
const response = await 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.
`[maxConcurrentShardRequests=5]`::
<<api-param-type-number,`Number`>> -- The number of concurrent shard requests each sub search executes concurrently per node. 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
`restTotalHitsAsInt`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether hits.total should be rendered as an integer or an object in the rest search response
`[ccsMinimizeRoundtrips=true]`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
`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/7.2/search-multi-search.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-msearchtemplate-7-2]]
=== `msearchTemplate`
[source,js]
--------
client.msearchTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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
`restTotalHitsAsInt`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether hits.total should be rendered as an integer or an object in the rest search response
`[ccsMinimizeRoundtrips=true]`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
`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/7.2/search-multi-search.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-mtermvectors-7-2]]
=== `mtermvectors`
[source,js]
--------
client.mtermvectors([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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".
`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/7.2/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-ping-7-2]]
=== `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-7-2]]
=== `putScript`
[source,js]
--------
client.putScript([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/modules-scripting.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-rankeval-7-2]]
=== `rankEval`
[source,js]
--------
client.rankEval([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/search-rank-eval.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 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`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/7.2/search-rank-eval.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-reindex-7-2]]
=== `reindex`
[source,js]
--------
client.reindex([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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.
`[scroll=5m]`::
<<api-param-type-duration-string,`DurationString`>> -- Control how long to keep the search context alive
`[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/7.2/docs-reindex.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-reindexrethrottle-7-2]]
=== `reindexRethrottle`
[source,js]
--------
client.reindexRethrottle([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/docs-reindex.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-rendersearchtemplate-7-2]]
=== `renderSearchTemplate`
[source,js]
--------
client.renderSearchTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/search-template.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-scriptspainlesscontext-7-2]]
=== `scriptsPainlessContext`
[source,js]
--------
client.scriptsPainlessContext([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and [the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`context`::
<<api-param-type-string,`String`>> -- Select a specific context to retrieve API information about
link:#[back to top]
[[api-scriptspainlessexecute-7-2]]
=== `scriptsPainlessExecute`
[source,js]
--------
client.scriptsPainlessExecute([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/painless/7.2/painless-execute-api.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
[[api-scroll-7-2]]
=== `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/7.2/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]
---------
const allTitles = [];
const responseQueue = [];
// start things off by searching, setting a scroll timeout, and pushing
// our first response into the queue to be processed
await 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'
})
while (responseQueue.length) {
const response = responseQueue.shift();
// collect the titles from this response
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});
// check to see if we have collected all of the titles
if (response.hits.total === allTitles.length) {
console.log('every "test" title', allTitles);
break
}
// get the next response if there are more titles to fetch
responseQueue.push(
await client.scroll({
scrollId: response._scroll_id,
scroll: '30s'
})
);
}
---------
*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
`restTotalHitsAsInt`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether hits.total should be rendered as an integer or an object in the rest search response
`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/7.2/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-search-7-2]]
=== `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/7.2/search-search.html[the elasticsearch docs] for more information pertaining to this method.
.Search with a simple query string query
[source,js]
---------
const response = await client.search({
index: 'myindex',
q: 'title:test'
});
---------
.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash`
[source,js]
---------
const response = await client.search({
index: 'myindex',
body: {
query: {
match: {
title: 'test'
}
},
facets: {
tags: {
terms: {
field: 'tags'
}
}
}
}
});
---------
*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)
`[ccsMinimizeRoundtrips=true]`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
`[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)
`ignoreThrottled`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled
`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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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
`[allowPartialSearchResults=true]`::
<<api-param-type-boolean,`Boolean`>> -- Indicate if an error should be returned if there is a partial search failure or timeout
`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
`seqNoPrimaryTerm`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to return sequence number and primary term of the last modification of each 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=5]`::
<<api-param-type-number,`Number`>> -- The number of concurrent shard requests per node 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.
`restTotalHitsAsInt`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether hits.total should be rendered as an integer or an object in the rest search 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/7.2/search-search.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-searchshards-7-2]]
=== `searchShards`
[source,js]
--------
client.searchShards([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/search-shards.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-searchtemplate-7-2]]
=== `searchTemplate`
[source,js]
--------
client.searchTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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)
`ignoreThrottled`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled
`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
`restTotalHitsAsInt`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether hits.total should be rendered as an integer or an object in the rest search response
`[ccsMinimizeRoundtrips=true]`::
<<api-param-type-boolean,`Boolean`>> -- Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
`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/7.2/search-template.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-termvectors-7-2]]
=== `termvectors`
[source,js]
--------
client.termvectors([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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.
`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/7.2/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-update-7-2]]
=== `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/7.2/docs-update.html[the elasticsearch docs] for more information pertaining to this method.
.Update document title using partial document
[source,js]
---------
const response = await client.update({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
// put the partial document under the `doc` key
doc: {
title: 'Updated'
}
}
})
---------
.Add a tag to document `tags` property using a `script`
[source,js]
---------
const response = await client.update({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
script: 'ctx._source.tags += tag',
params: { tag: 'some new tag' }
}
});
---------
.Increment a document counter by 1 or initialize it, when the document does not exist
[source,js]
---------
const response = await client.update({
index: 'myindex',
type: 'mytype',
id: '777',
body: {
script: 'ctx._source.counter += 1',
upsert: {
counter: 1
}
}
})
---------
.Delete a document if it's tagged “to-delete”
[source,js]
---------
const response = await 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'
}
}
});
---------
*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)
`_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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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)
`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
`ifSeqNo`::
<<api-param-type-number,`Number`>> -- only perform the update operation if the last operation that has changed the document has the specified sequence number
`ifPrimaryTerm`::
<<api-param-type-number,`Number`>> -- only perform the update operation if the last operation that has changed the document has the specified primary term
`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/7.2/docs-update.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-updatebyquery-7-2]]
=== `updateByQuery`
[source,js]
--------
client.updateByQuery([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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
`_sourceExcludes`::
<<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
`_sourceIncludes`::
<<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/7.2/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-updatebyqueryrethrottle-7-2]]
=== `updateByQueryRethrottle`
[source,js]
--------
client.updateByQueryRethrottle([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/docs-update-by-query.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/7.2/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-cat-aliases-7-2]]
=== `cat.aliases`
[source,js]
--------
client.cat.aliases([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.allocation`
[source,js]
--------
client.cat.allocation([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.count`
[source,js]
--------
client.cat.count([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.fielddata`
[source,js]
--------
client.cat.fielddata([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.health`
[source,js]
--------
client.cat.health([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.help`
[source,js]
--------
client.cat.help([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.indices`
[source,js]
--------
client.cat.indices([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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
`includeUnloadedSegments`::
<<api-param-type-boolean,`Boolean`>> -- If set to true segment stats will include stats for segments that are not currently loaded into memory
`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-7-2]]
=== `cat.master`
[source,js]
--------
client.cat.master([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.nodeattrs`
[source,js]
--------
client.cat.nodeattrs([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.nodes`
[source,js]
--------
client.cat.nodes([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.pendingTasks`
[source,js]
--------
client.cat.pendingTasks([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.plugins`
[source,js]
--------
client.cat.plugins([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.recovery`
[source,js]
--------
client.cat.recovery([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.repositories`
[source,js]
--------
client.cat.repositories([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.segments`
[source,js]
--------
client.cat.segments([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.shards`
[source,js]
--------
client.cat.shards([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.snapshots`
[source,js]
--------
client.cat.snapshots([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.tasks`
[source,js]
--------
client.cat.tasks([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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)
`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-7-2]]
=== `cat.templates`
[source,js]
--------
client.cat.templates([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cat.threadPool`
[source,js]
--------
client.cat.threadPool([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `cluster.allocationExplain`
[source,js]
--------
client.cluster.allocationExplain([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-cluster-getsettings-7-2]]
=== `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/7.2/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-7-2]]
=== `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/7.2/cluster-health.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`[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"`
`[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
`waitForNoInitializingShards`::
<<api-param-type-boolean,`Boolean`>> -- Whether to wait until there are no initializing 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-7-2]]
=== `cluster.pendingTasks`
[source,js]
--------
client.cluster.pendingTasks([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `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/7.2/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`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/7.2/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-cluster-remoteinfo-7-2]]
=== `cluster.remoteInfo`
[source,js]
--------
client.cluster.remoteInfo([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/cluster-remote-info.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
[[api-cluster-reroute-7-2]]
=== `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/7.2/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/7.2/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-cluster-state-7-2]]
=== `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/7.2/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)
`waitForMetadataVersion`::
<<api-param-type-number,`Number`>> -- Wait for the metadata version to be equal or greater than the specified metadata version
`waitForTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- The maximum time to wait for wait_for_metadata_version before timing out
`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-7-2]]
=== `cluster.stats`
[source,js]
--------
client.cluster.stats([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `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/7.2/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
`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/7.2/indices-analyze.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-clearcache-7-2]]
=== `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/7.2/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
`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 `fielddata` 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
`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/7.2/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-close-7-2]]
=== `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/7.2/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"`
`waitForActiveShards`::
<<api-param-type-string,`String`>> -- Sets the number of active shards to wait for before the operation returns.
`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/7.2/indices-open-close.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-create-7-2]]
=== `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/7.2/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeTypeName`::
<<api-param-type-boolean,`Boolean`>> -- Whether a type should be expected in the body of the mappings.
`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
`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/7.2/indices-create-index.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-delete-7-2]]
=== `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/7.2/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/7.2/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-deletealias-7-2]]
=== `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/7.2/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/7.2/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-deletetemplate-7-2]]
=== `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/7.2/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/7.2/indices-templates.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-exists-7-2]]
=== `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/7.2/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/7.2/indices-exists.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-existsalias-7-2]]
=== `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/7.2/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/7.2/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-existstemplate-7-2]]
=== `indices.existsTemplate`
[source,js]
--------
client.indices.existsTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/indices-templates.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-existstype-7-2]]
=== `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/7.2/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/7.2/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-flush-7-2]]
=== `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/7.2/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/7.2/indices-flush.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-flushsynced-7-2]]
=== `indices.flushSynced`
[source,js]
--------
client.indices.flushSynced([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-forcemerge-7-2]]
=== `indices.forcemerge`
[source,js]
--------
client.indices.forcemerge([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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
`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/7.2/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-get-7-2]]
=== `indices.get`
[source,js]
--------
client.indices.get([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeTypeName`::
<<api-param-type-boolean,`Boolean`>> -- Whether to add the type name to the response (default: false)
`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.
`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
link:#[back to top]
[[api-indices-getalias-7-2]]
=== `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/7.2/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-7-2]]
=== `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/7.2/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeTypeName`::
<<api-param-type-boolean,`Boolean`>> -- Whether a type should be returned in the body of the mappings.
`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-7-2]]
=== `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/7.2/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeTypeName`::
<<api-param-type-boolean,`Boolean`>> -- Whether to add the type name to the response (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"`
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`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-7-2]]
=== `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/7.2/indices-get-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
`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-7-2]]
=== `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/7.2/indices-templates.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeTypeName`::
<<api-param-type-boolean,`Boolean`>> -- Whether a type should be returned in the body of the mappings.
`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-7-2]]
=== `indices.getUpgrade`
[source,js]
--------
client.indices.getUpgrade([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `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/7.2/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"`
`waitForActiveShards`::
<<api-param-type-string,`String`>> -- Sets the number of active shards to wait for before the operation returns.
`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/7.2/indices-open-close.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-putalias-7-2]]
=== `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/7.2/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/7.2/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-putmapping-7-2]]
=== `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/7.2/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeTypeName`::
<<api-param-type-boolean,`Boolean`>> -- Whether a type should be expected in the body of the mappings.
`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 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/7.2/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-putsettings-7-2]]
=== `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/7.2/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
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`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/7.2/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-puttemplate-7-2]]
=== `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/7.2/indices-templates.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeTypeName`::
<<api-param-type-boolean,`Boolean`>> -- Whether a type should be returned in the body of the mappings.
`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/7.2/indices-templates.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-recovery-7-2]]
=== `indices.recovery`
[source,js]
--------
client.indices.recovery([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `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/7.2/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/7.2/indices-refresh.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-rollover-7-2]]
=== `indices.rollover`
[source,js]
--------
client.indices.rollover([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeTypeName`::
<<api-param-type-boolean,`Boolean`>> -- Whether a type should be included in the body of the mappings.
`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/7.2/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-segments-7-2]]
=== `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/7.2/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"`
`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-7-2]]
=== `indices.shardStores`
[source,js]
--------
client.indices.shardStores([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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"`
`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-7-2]]
=== `indices.shrink`
[source,js]
--------
client.indices.shrink([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`copySettings`::
<<api-param-type-boolean,`Boolean`>> -- whether or not to copy settings from the source index (defaults to false)
`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/7.2/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-split-7-2]]
=== `indices.split`
[source,js]
--------
client.indices.split([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/indices-split-index.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`copySettings`::
<<api-param-type-boolean,`Boolean`>> -- whether or not to copy settings from the source index (defaults to false)
`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 split
`target`::
<<api-param-type-string,`String`>> -- The name of the target index to split 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/7.2/indices-split-index.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-stats-7-2]]
=== `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/7.2/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)
`includeUnloadedSegments`::
<<api-param-type-boolean,`Boolean`>> -- If set to true segment stats will include stats for segments that are not currently loaded into memory
`[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"`
`[forbidClosedIndices=true]`::
<<api-param-type-boolean,`Boolean`>> -- If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed 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
`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-7-2]]
=== `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/7.2/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method.
.Perform an atomic alias swap, for a rotating index
[source,js]
---------
const response = await client.indices.updateAliases({
body: {
actions: [
{ remove: { index: 'logstash-2014.04', alias: 'logstash-current' } },
{ add: { index: 'logstash-2014.05', alias: 'logstash-current' } }
]
}
});
---------
*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/7.2/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-upgrade-7-2]]
=== `indices.upgrade`
[source,js]
--------
client.indices.upgrade([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-validatequery-7-2]]
=== `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/7.2/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"`
`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/7.2/search-validate.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-ingest-deletepipeline-7-2]]
=== `ingest.deletePipeline`
[source,js]
--------
client.ingest.deletePipeline([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/delete-pipeline-api.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/reference/7.2/delete-pipeline-api.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-ingest-getpipeline-7-2]]
=== `ingest.getPipeline`
[source,js]
--------
client.ingest.getPipeline([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/get-pipeline-api.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-7-2]]
=== `ingest.processorGrok`
[source,js]
--------
client.ingest.processorGrok([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/grok-processor.html#grok-processor-rest-get[the elasticsearch docs] for more information pertaining to this method.
// no examples
[[api-ingest-putpipeline-7-2]]
=== `ingest.putPipeline`
[source,js]
--------
client.ingest.putPipeline([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/put-pipeline-api.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/reference/7.2/put-pipeline-api.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-ingest-simulate-7-2]]
=== `ingest.simulate`
[source,js]
--------
client.ingest.simulate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/simulate-pipeline-api.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/reference/7.2/simulate-pipeline-api.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-nodes-hotthreads-7-2]]
=== `nodes.hotThreads`
[source,js]
--------
client.nodes.hotThreads([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `nodes.info`
[source,js]
--------
client.nodes.info([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-reloadsecuresettings-7-2]]
=== `nodes.reloadSecureSettings`
[source,js]
--------
client.nodes.reloadSecureSettings([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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 to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
`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/7.2/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-nodes-stats-7-2]]
=== `nodes.stats`
[source,js]
--------
client.nodes.stats([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `nodes.usage`
[source,js]
--------
client.nodes.usage([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/cluster-nodes-usage.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
`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-7-2]]
=== `snapshot.create`
[source,js]
--------
client.snapshot.create([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-createrepository-7-2]]
=== `snapshot.createRepository`
[source,js]
--------
client.snapshot.createRepository([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-delete-7-2]]
=== `snapshot.delete`
[source,js]
--------
client.snapshot.delete([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-deleterepository-7-2]]
=== `snapshot.deleteRepository`
[source,js]
--------
client.snapshot.deleteRepository([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-get-7-2]]
=== `snapshot.get`
[source,js]
--------
client.snapshot.get([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `snapshot.getRepository`
[source,js]
--------
client.snapshot.getRepository([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `snapshot.restore`
[source,js]
--------
client.snapshot.restore([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-status-7-2]]
=== `snapshot.status`
[source,js]
--------
client.snapshot.status([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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-7-2]]
=== `snapshot.verifyRepository`
[source,js]
--------
client.snapshot.verifyRepository([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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/7.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-tasks-cancel-7-2]]
=== `tasks.cancel`
[source,js]
--------
client.tasks.cancel([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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.
`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/7.2/tasks.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-tasks-get-7-2]]
=== `tasks.get`
[source,js]
--------
client.tasks.get([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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)
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`taskId`::
<<api-param-type-string,`String`>> -- Return the task with specified id (node_id:task_number)
link:#[back to top]
[[api-tasks-list-7-2]]
=== `tasks.list`
[source,js]
--------
client.tasks.list([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.2/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)
`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"`
* `"none"`
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
link:#[back to top]