Files
elasticsearch-js/docs/api_methods_1_7.asciidoc
2018-10-29 12:21:37 -07:00

4845 lines
178 KiB
Plaintext

[[api-reference-1-7]]
== 1.7 API
NOTE: At this time, you must opt into the 1.7 API by setting the `apiVersion` config parameter.
[[api-bulk-1-7]]
=== `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/1.7/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]
`consistency`::
<<api-param-type-string,`String`>> -- Explicit write consistency setting for the operation
Options:::
* `"one"`
* `"quorum"`
* `"all"`
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the index after performing the operation
`[replication=sync]`::
<<api-param-type-string,`String`>> -- Explicitely set the replication type
Options:::
* `"sync"`
* `"async"`
`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
`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/1.7/docs-bulk.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-clearscroll-1-7]]
=== `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/1.7/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/1.7/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-count-1-7]]
=== `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/1.7/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)
`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`>> -- Specific routing value
`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
`lowercaseExpandedTerms`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether query terms should be lowercased
`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/1.7/search-count.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-countpercolate-1-7]]
=== `countPercolate`
[source,js]
--------
client.countPercolate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-percolate.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`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"`
`percolateIndex`::
<<api-param-type-string,`String`>> -- The index to count percolate the document into. Defaults to index.
`percolateType`::
<<api-param-type-string,`String`>> -- The type to count percolate document into. Defaults to type.
`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 of the document being count percolated.
`type`::
<<api-param-type-string,`String`>> -- The type of the document being count percolated.
`id`::
<<api-param-type-string,`String`>> -- Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster.
`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/1.7/search-percolate.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-create-1-7]]
=== `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/1.7/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]
`consistency`::
<<api-param-type-string,`String`>> -- Explicit write consistency setting for the operation
Options:::
* `"one"`
* `"quorum"`
* `"all"`
`parent`::
<<api-param-type-string,`String`>> -- ID of the parent document
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the index after performing the operation
`[replication=sync]`::
<<api-param-type-string,`String`>> -- Specific replication type
Options:::
* `"sync"`
* `"async"`
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`timestamp`::
Timestamp -- Explicit timestamp for the document
`ttl`::
<<api-param-type-duration-string,`DurationString`>> -- Expiration time for the document
`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`>> -- 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/1.7/docs-index_.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-delete-1-7]]
=== `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/1.7/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]
`consistency`::
<<api-param-type-string,`String`>> -- Specific write consistency setting for the operation
Options:::
* `"one"`
* `"quorum"`
* `"all"`
`parent`::
<<api-param-type-string,`String`>> -- ID of parent document
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the index after performing the operation
`[replication=sync]`::
<<api-param-type-string,`String`>> -- Specific replication type
Options:::
* `"sync"`
* `"async"`
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
* `"internal"`
* `"external"`
* `"external_gte"`
* `"force"`
`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-delete.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-deletebyquery-1-7]]
=== `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/1.7/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
`consistency`::
<<api-param-type-string,`String`>> -- Specific write consistency setting for the operation
Options:::
* `"one"`
* `"quorum"`
* `"all"`
`[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
`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"`
`[replication=sync]`::
<<api-param-type-string,`String`>> -- Specific replication type
Options:::
* `"sync"`
* `"async"`
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`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 operation; use `_all` 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 types to restrict 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/1.7/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-deletescript-1-7]]
=== `deleteScript`
[source,js]
--------
client.deleteScript([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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`>> -- Script ID
`lang`::
<<api-param-type-string,`String`>> -- Script language
`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/1.7/modules-scripting.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-deletetemplate-1-7]]
=== `deleteTemplate`
[source,js]
--------
client.deleteTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-template.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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`>> -- Template 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/1.7/search-template.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-exists-1-7]]
=== `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/1.7/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]
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to perform the operation in realtime or search mode
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the shard containing the document before performing the operation
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`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/1.7/docs-get.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-explain-1-7]]
=== `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/1.7/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)
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return in the response
`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`lowercaseExpandedTerms`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether query terms should be lowercased
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-explain.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-fieldstats-1-7]]
=== `fieldStats`
[source,js]
--------
client.fieldStats([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-field-stats.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 fields for to get field statistics for (min value, max value, and more)
`[level=cluster]`::
<<api-param-type-string,`String`>> -- Defines if field stats should be returned on a per index level or on a cluster wide level
Options:::
* `"indices"`
* `"cluster"`
`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/1.7/search-field-stats.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-get-1-7]]
=== `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/1.7/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]
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return in the response
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to perform the operation in realtime or search mode
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the shard containing the document before performing the operation
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
* `"internal"`
* `"external"`
* `"external_gte"`
* `"force"`
`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document (use `_all` to fetch the first document matching the ID across all types)
link:#[back to top]
[[api-getscript-1-7]]
=== `getScript`
[source,js]
--------
client.getScript([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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`>> -- Script ID
`lang`::
<<api-param-type-string,`String`>> -- Script language
link:#[back to top]
[[api-getsource-1-7]]
=== `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/1.7/docs-get.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`parent`::
<<api-param-type-string,`String`>> -- The ID of the parent document
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to perform the operation in realtime or search mode
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the shard containing the document before performing the operation
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
* `"internal"`
* `"external"`
* `"external_gte"`
* `"force"`
`id`::
<<api-param-type-string,`String`>> -- The document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document; use `_all` to fetch the first document matching the ID across all types
link:#[back to top]
[[api-gettemplate-1-7]]
=== `getTemplate`
[source,js]
--------
client.getTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-template.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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`>> -- Template ID
link:#[back to top]
[[api-index-1-7]]
=== `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/1.7/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]
`consistency`::
<<api-param-type-string,`String`>> -- Explicit write consistency setting for the operation
Options:::
* `"one"`
* `"quorum"`
* `"all"`
`[opType=index]`::
<<api-param-type-string,`String`>> -- Explicit operation type
Options:::
* `"index"`
* `"create"`
`parent`::
<<api-param-type-string,`String`>> -- ID of the parent document
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the index after performing the operation
`[replication=sync]`::
<<api-param-type-string,`String`>> -- Specific replication type
Options:::
* `"sync"`
* `"async"`
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`timestamp`::
Timestamp -- Explicit timestamp for the document
`ttl`::
<<api-param-type-duration-string,`DurationString`>> -- Expiration time for the document
`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`>> -- 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/1.7/docs-index_.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-info-1-7]]
=== `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-1-7]]
=== `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/1.7/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]
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return in the response
`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
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-mlt-1-7]]
=== `mlt`
[source,js]
--------
client.mlt([params, [callback]])
--------
(more like this) Gets more documents that are “like” the document specified using `index`, `type`, and `id`.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-more-like-this.html[the elasticsearch docs] for more information pertaining to this method.
.Search for similar documents using the `title` property of document `myindex/mytype/1`
[source,js]
---------
const response = await client.mlt({
index: 'myindex',
type: 'mytype',
id: 1,
mlt_fields: 'title'
});
---------
*Params*
[horizontal]
`boostTerms`::
<<api-param-type-number,`Number`>> -- The boost factor
`maxDocFreq`::
<<api-param-type-number,`Number`>> -- The word occurrence frequency as count: words with higher occurrence in the corpus will be ignored
`maxQueryTerms`::
<<api-param-type-number,`Number`>> -- The maximum query terms to be included in the generated query
`maxWordLength`::
<<api-param-type-number,`Number`>> -- The minimum length of the word: longer words will be ignored
`minDocFreq`::
<<api-param-type-number,`Number`>> -- The word occurrence frequency as count: words with lower occurrence in the corpus will be ignored
`minTermFreq`::
<<api-param-type-number,`Number`>> -- The term frequency as percent: terms with lower occurence in the source document will be ignored
`minWordLength`::
<<api-param-type-number,`Number`>> -- The minimum length of the word: shorter words will be ignored
`mltFields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Specific fields to perform the query against
`percentTermsToMatch`::
<<api-param-type-number,`Number`>> -- How many terms have to match in order to consider the document a match (default: 0.3)
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`searchFrom`::
<<api-param-type-number,`Number`>> -- The offset from which to return results
`searchIndices`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of indices to perform the query against (default: the index containing the document)
`searchScroll`::
<<api-param-type-string,`String`>> -- A scroll search request definition
`searchSize`::
<<api-param-type-number,`Number`>> -- The number of documents to return (default: 10)
`searchSource`::
<<api-param-type-string,`String`>> -- A specific search request definition (instead of using the request body)
`searchType`::
<<api-param-type-string,`String`>> -- Specific search type (eg. `dfs_then_fetch`, `count`, etc)
`searchTypes`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of types to perform the query against (default: the same type as the document)
`stopWords`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of stop words to be ignored
`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/1.7/search-more-like-this.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-mpercolate-1-7]]
=== `mpercolate`
[source,js]
--------
client.mpercolate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-percolate.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`>> -- The index of the document being count percolated to use as default
`type`::
<<api-param-type-string,`String`>> -- The type of the document being percolated 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/1.7/search-percolate.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-msearch-1-7]]
=== `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/1.7/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"`
* `"count"`
* `"scan"`
`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/1.7/search-multi-search.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-mtermvectors-1-7]]
=== `mtermvectors`
[source,js]
--------
client.mtermvectors([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`ids`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
`termStatistics`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`[fieldStatistics=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`[offsets=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`[positions=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`[payloads=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs".
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`parent`::
<<api-param-type-string,`String`>> -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs".
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if requests are real-time as opposed to near-real-time (default: true).
`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/1.7/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-percolate-1-7]]
=== `percolate`
[source,js]
--------
client.percolate([params, [callback]])
--------
Match a document against registered percolator queries.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-percolate.html[the elasticsearch docs] for more information pertaining to this method.
.First, Register queries named “alert-1” and “alert-2” for the “myindex” index
[source,js]
---------
await Promise.all([
client.index({
index: 'myindex',
type: '.percolator',
id: 'alert-1',
body: {
// This query will be run against documents sent to percolate
query: {
query_string: {
query: 'foo'
}
}
}
}),
client.index({
index: 'myindex',
type: '.percolator',
id: 'alert-2',
body: {
// This query will also be run against documents sent to percolate
query: {
query_string: {
query: 'bar'
}
}
}
})
]);
---------
.Then you can send documents to learn which query `_percolator` queries they match
[source,js]
---------
const response1 = await client.percolate({
index: 'myindex',
type: 'mytype',
body: {
doc: {
title: "Foo"
}
}
});
// response1 should look something like
// {
// total: 1,
// matches: [ { _index: 'myindex', _id: 'alert-1' } ]
// }
const response2 = await client.percolate({
index: 'myindex',
type: 'mytype',
body: {
doc: {
title: "Foo Bar"
}
}
});
// response2 should look something like
// {
// total: 2,
// matches: [
// { _index: 'myindex', _id: 'alert-1' },
// { _index: 'myindex', _id: 'alert-2' }
// ]
// }
---------
*Params*
[horizontal]
`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
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`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"`
`percolateFormat`::
<<api-param-type-string,`String`>> -- Return an array of matching query IDs instead of objects
Options:::
* `"ids"`
`percolateIndex`::
<<api-param-type-string,`String`>> -- The index to percolate the document into. Defaults to index.
`percolateType`::
<<api-param-type-string,`String`>> -- The type to percolate document into. Defaults to type.
`percolateRouting`::
<<api-param-type-string,`String`>> -- The routing value to use when percolating the existing document.
`percolatePreference`::
<<api-param-type-string,`String`>> -- Which shard to prefer when executing the percolate request.
`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 of the document being percolated.
`type`::
<<api-param-type-string,`String`>> -- The type of the document being percolated.
`id`::
<<api-param-type-string,`String`>> -- Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster.
`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/1.7/search-percolate.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-ping-1-7]]
=== `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-1-7]]
=== `putScript`
[source,js]
--------
client.putScript([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`[opType=index]`::
<<api-param-type-string,`String`>> -- Explicit operation type
Options:::
* `"index"`
* `"create"`
`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`>> -- Script ID
`lang`::
<<api-param-type-string,`String`>> -- Script language
`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/1.7/modules-scripting.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-puttemplate-1-7]]
=== `putTemplate`
[source,js]
--------
client.putTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-template.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`[opType=index]`::
<<api-param-type-string,`String`>> -- Explicit operation type
Options:::
* `"index"`
* `"create"`
`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`>> -- Template 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/1.7/search-template.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-scroll-1-7]]
=== `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/1.7/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method.
.Collect every title in the index that contains the word "test"
[source,js]
---------
var allTitles = [];
// first we do a search, and specify a scroll timeout
client.search({
index: 'myindex',
// Set to 30 seconds because we are calling right back
scroll: '30s',
search_type: 'scan',
fields: ['title'],
q: 'title:test'
}, function getMoreUntilDone(error, response) {
// collect the title from each response
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});
if (response.hits.total !== allTitles.length) {
// now we can call scroll over and over
client.scroll({
scrollId: response._scroll_id,
scroll: '30s'
}, getMoreUntilDone);
} else {
console.log('every "test" title', allTitles);
}
});
---------
*Params*
[horizontal]
`scroll`::
<<api-param-type-duration-string,`DurationString`>> -- Specify how long a consistent view of the index should be maintained for scrolled search
`scrollId`::
<<api-param-type-string,`String`>> -- The scroll ID
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-search-1-7]]
=== `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], https://github.com/holidayextras/esq[esq], and https://github.com/fullscale/elastic.js[elastic.js] can be used to make building query bodies easier.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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)
`[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
`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 as part of a hit
`fielddataFields`::
<<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 field data representation of a field for each hit
`from`::
<<api-param-type-number,`Number`>> -- Starting offset (default: 0)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`lowercaseExpandedTerms`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether query terms should be lowercased
`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"`
* `"query_and_fetch"`
* `"dfs_query_then_fetch"`
* `"dfs_query_and_fetch"`
* `"count"`
* `"scan"`
`size`::
<<api-param-type-number,`Number`>> -- Number of hits to return (default: 10)
`sort`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of <field>:<direction> pairs
`_source`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- True or false to return the _source field or not, or a list of fields to return
`_sourceExclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to exclude from the returned _source field
`_sourceInclude`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A list of fields to extract and return from the _source field
`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
`version`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to return document version as part of a hit
`queryCache`::
<<api-param-type-boolean,`Boolean`>> -- Specify if query cache should be used for this request or not, defaults to index level setting
`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/1.7/search-search.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-searchexists-1-7]]
=== `searchExists`
[source,js]
--------
client.searchExists([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-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"`
`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`>> -- Specific routing value
`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
`lowercaseExpandedTerms`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether query terms should be lowercased
`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/1.7/search-exists.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-searchshards-1-7]]
=== `searchShards`
[source,js]
--------
client.searchShards([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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`>> -- 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/1.7/search-shards.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-searchtemplate-1-7]]
=== `searchTemplate`
[source,js]
--------
client.searchTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-template.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`routing`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of specific routing values
`scroll`::
<<api-param-type-duration-string,`DurationString`>> -- Specify how long a consistent view of the index should be maintained for scrolled search
`searchType`::
<<api-param-type-string,`String`>> -- Search operation type
Options:::
* `"query_then_fetch"`
* `"query_and_fetch"`
* `"dfs_query_then_fetch"`
* `"dfs_query_and_fetch"`
* `"count"`
* `"scan"`
`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/1.7/search-template.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-suggest-1-7]]
=== `suggest`
[source,js]
--------
client.suggest([params, [callback]])
--------
The suggest feature suggests similar looking terms based on a provided text by using a specific suggester.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-suggesters.html[the elasticsearch docs] for more information pertaining to this method.
.Return query terms suggestions (“auto-correction”)
[source,js]
---------
const response = await client.suggest({
index: 'myindex',
body: {
mysuggester: {
text: 'tset',
term: {
field: 'title'
}
}
}
});
// response will be formatted like so:
//
// {
// ...
// mysuggester: [
// {
// text: "tset",
// ...
// options: [
// {
// text: "test",
// score: 0.75,
// freq: 5
// }
// ]
// }
// ]
// }
---------
*Params*
[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random)
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value
`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
`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/1.7/search-suggesters.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-termvector-1-7]]
=== `termvector`
[source,js]
--------
client.termvector([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`termStatistics`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if total term frequency and document frequency should be returned.
`[fieldStatistics=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return.
`[offsets=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term offsets should be returned.
`[positions=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term positions should be returned.
`[payloads=true]`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if term payloads should be returned.
`preference`::
<<api-param-type-string,`String`>> -- Specify the node or shard the operation should be performed on (default: random).
`routing`::
<<api-param-type-string,`String`>> -- Specific routing value.
`parent`::
<<api-param-type-string,`String`>> -- Parent id of documents.
`realtime`::
<<api-param-type-boolean,`Boolean`>> -- Specifies if request is real-time as opposed to near-real-time (default: true).
`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.
`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/1.7/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-update-1-7]]
=== `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/1.7/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]
`consistency`::
<<api-param-type-string,`String`>> -- Explicit write consistency setting for the operation
Options:::
* `"one"`
* `"quorum"`
* `"all"`
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to return in the response
`lang`::
<<api-param-type-string,`String`>> -- The script language (default: groovy)
`parent`::
<<api-param-type-string,`String`>> -- ID of the parent document. Is is only used for routing and when for the upsert request
`refresh`::
<<api-param-type-boolean,`Boolean`>> -- Refresh the index after performing the operation
`[replication=sync]`::
<<api-param-type-string,`String`>> -- Specific replication type
Options:::
* `"sync"`
* `"async"`
`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
`script`::
<<api-param-type-string,`String`>> -- The URL-encoded script definition (instead of using request body)
`scriptId`::
<<api-param-type-string,`String`>> -- The id of a stored script
`scriptedUpsert`::
<<api-param-type-boolean,`Boolean`>> -- True if the script referenced in script or script_id should be called to perform inserts - defaults to false
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`timestamp`::
Timestamp -- Explicit timestamp for the document
`ttl`::
<<api-param-type-duration-string,`DurationString`>> -- Expiration time for the document
`version`::
<<api-param-type-number,`Number`>> -- Explicit version number for concurrency control
`versionType`::
<<api-param-type-string,`String`>> -- Specific version type
Options:::
* `"internal"`
* `"force"`
`id`::
<<api-param-type-string,`String`>> -- Document ID
`index`::
<<api-param-type-string,`String`>> -- The name of the index
`type`::
<<api-param-type-string,`String`>> -- The type of the document
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-update.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-cat-aliases-1-7]]
=== `cat.aliases`
[source,js]
--------
client.cat.aliases([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat.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`>> -- 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
`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-1-7]]
=== `cat.allocation`
[source,js]
--------
client.cat.allocation([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`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-1-7]]
=== `cat.count`
[source,js]
--------
client.cat.count([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-count.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`>> -- 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
`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-1-7]]
=== `cat.fielddata`
[source,js]
--------
client.cat.fielddata([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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
`help`::
<<api-param-type-boolean,`Boolean`>> -- Return help information
`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-1-7]]
=== `cat.health`
[source,js]
--------
client.cat.health([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-health.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`>> -- 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
`[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-1-7]]
=== `cat.help`
[source,js]
--------
client.cat.help([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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
link:#[back to top]
[[api-cat-indices-1-7]]
=== `cat.indices`
[source,js]
--------
client.cat.indices([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-indices.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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
`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
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names to limit the returned information
link:#[back to top]
[[api-cat-master-1-7]]
=== `cat.master`
[source,js]
--------
client.cat.master([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-master.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`>> -- 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
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
link:#[back to top]
[[api-cat-nodes-1-7]]
=== `cat.nodes`
[source,js]
--------
client.cat.nodes([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-nodes.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`>> -- 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
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
link:#[back to top]
[[api-cat-pendingtasks-1-7]]
=== `cat.pendingTasks`
[source,js]
--------
client.cat.pendingTasks([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-pending-tasks.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`>> -- 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
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
link:#[back to top]
[[api-cat-plugins-1-7]]
=== `cat.plugins`
[source,js]
--------
client.cat.plugins([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-plugins.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`>> -- 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
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
link:#[back to top]
[[api-cat-recovery-1-7]]
=== `cat.recovery`
[source,js]
--------
client.cat.recovery([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`bytes`::
<<api-param-type-string,`String`>> -- The unit in which to display byte values
Options:::
* `"b"`
* `"k"`
* `"m"`
* `"g"`
`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
`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-segments-1-7]]
=== `cat.segments`
[source,js]
--------
client.cat.segments([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-segments.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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
`[v=true]`::
<<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-1-7]]
=== `cat.shards`
[source,js]
--------
client.cat.shards([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-shards.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`>> -- 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
`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-threadpool-1-7]]
=== `cat.threadPool`
[source,js]
--------
client.cat.threadPool([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-thread-pool.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`>> -- 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
`v`::
<<api-param-type-boolean,`Boolean`>> -- Verbose mode. Display column headers
`fullId`::
<<api-param-type-boolean,`Boolean`>> -- Enables displaying the complete node ids
link:#[back to top]
[[api-cluster-getsettings-1-7]]
=== `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/1.7/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
link:#[back to top]
[[api-cluster-health-1-7]]
=== `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/1.7/cluster-health.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`[level=cluster]`::
<<api-param-type-string,`String`>> -- Specify the level of detail for returned information
Options:::
* `"cluster"`
* `"indices"`
* `"shards"`
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`waitForActiveShards`::
<<api-param-type-number,`Number`>> -- Wait until the specified number of shards is active
`waitForNodes`::
<<api-param-type-string,`String`>> -- Wait until the specified number of nodes is available
`waitForRelocatingShards`::
<<api-param-type-number,`Number`>> -- Wait until the specified number of relocating shards is finished
`waitForStatus`::
<<api-param-type-string,`String`>> -- Wait until cluster is in a specific state
Options:::
* `"green"`
* `"yellow"`
* `"red"`
`index`::
<<api-param-type-string,`String`>> -- Limit the information returned to a specific index
link:#[back to top]
[[api-cluster-pendingtasks-1-7]]
=== `cluster.pendingTasks`
[source,js]
--------
client.cluster.pendingTasks([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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-1-7]]
=== `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/1.7/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout for connection to master node
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-cluster-reroute-1-7]]
=== `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/1.7/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
`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/1.7/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-cluster-state-1-7]]
=== `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/1.7/cluster-state.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`metric`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- Limit the information returned to the specified metrics
link:#[back to top]
[[api-cluster-stats-1-7]]
=== `cluster.stats`
[source,js]
--------
client.cluster.stats([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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)
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`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-1-7]]
=== `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/1.7/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`analyzer`::
<<api-param-type-string,`String`>> -- The name of the analyzer to use
`charFilters`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of character filters to use for the analysis
`field`::
<<api-param-type-string,`String`>> -- Use the analyzer configured for this field (instead of passing the analyzer name)
`filters`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of filters to use for the analysis
`index`::
<<api-param-type-string,`String`>> -- The name of the index to scope the operation
`preferLocal`::
<<api-param-type-boolean,`Boolean`>> -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true)
`text`::
<<api-param-type-string,`String`>> -- The text on which the analysis should be performed (when request body is not used)
`tokenizer`::
<<api-param-type-string,`String`>> -- The name of the tokenizer to use for the analysis
`[format=detailed]`::
<<api-param-type-string,`String`>> -- Format of the output
Options:::
* `"detailed"`
* `"text"`
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-analyze.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-clearcache-1-7]]
=== `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/1.7/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`fieldData`::
<<api-param-type-boolean,`Boolean`>> -- Clear field data
`fielddata`::
<<api-param-type-boolean,`Boolean`>> -- Clear field data
`fields`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all)
`filter`::
<<api-param-type-boolean,`Boolean`>> -- Clear filter caches
`filterCache`::
<<api-param-type-boolean,`Boolean`>> -- Clear filter caches
`filterKeys`::
<<api-param-type-boolean,`Boolean`>> -- A comma-separated list of keys to clear when using the `filter_cache` parameter (default: all)
`id`::
<<api-param-type-boolean,`Boolean`>> -- Clear ID caches for parent/child
`idCache`::
<<api-param-type-boolean,`Boolean`>> -- Clear ID caches for parent/child
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index name to limit the operation
`recycler`::
<<api-param-type-boolean,`Boolean`>> -- Clear the recycler cache
`queryCache`::
<<api-param-type-boolean,`Boolean`>> -- Clear query 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/1.7/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-close-1-7]]
=== `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/1.7/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`index`::
<<api-param-type-string,`String`>> -- 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/1.7/indices-open-close.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-create-1-7]]
=== `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/1.7/indices-create-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
`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/1.7/indices-create-index.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-delete-1-7]]
=== `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/1.7/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
`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/1.7/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-deletealias-1-7]]
=== `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/1.7/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/1.7/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-deletemapping-1-7]]
=== `indices.deleteMapping`
[source,js]
--------
client.indices.deleteMapping([params, [callback]])
--------
Delete a mapping (type definition) along with its data.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-delete-mapping.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
`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
`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 delete (supports wildcards); use `_all` to delete all document types in 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/1.7/indices-delete-mapping.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-deletetemplate-1-7]]
=== `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/1.7/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/1.7/indices-templates.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-deletewarmer-1-7]]
=== `indices.deleteWarmer`
[source,js]
--------
client.indices.deleteWarmer([params, [callback]])
--------
Delete an index warmer.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-warmers.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
`name`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of warmer names to delete (supports wildcards); use `_all` to delete all warmers in the specified indices. You must specify a name either in the uri or in the parameters.
`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 delete warmers from (supports wildcards); use `_all` 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/1.7/indices-warmers.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-exists-1-7]]
=== `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/1.7/indices-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 indices 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/1.7/indices-exists.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-existsalias-1-7]]
=== `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/1.7/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=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"`
`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/1.7/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-existstemplate-1-7]]
=== `indices.existsTemplate`
[source,js]
--------
client.indices.existsTemplate([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.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)
`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/1.7/indices-templates.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-existstype-1-7]]
=== `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/1.7/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/1.7/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-flush-1-7]]
=== `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/1.7/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 false and will cause an exception to be thrown on the shard level 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/1.7/indices-flush.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-flushsynced-1-7]]
=== `indices.flushSynced`
[source,js]
--------
client.indices.flushSynced([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`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
`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"`
`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/1.7/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-get-1-7]]
=== `indices.get`
[source,js]
--------
client.indices.get([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Ignore unavailable indexes (default: false)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Ignore if a wildcard expression resolves to no concrete indices (default: false)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether wildcard expressions should get expanded to open or closed indices (default: open)
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names
`feature`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of features
link:#[back to top]
[[api-indices-getalias-1-7]]
=== `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/1.7/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=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 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-getaliases-1-7]]
=== `indices.getAliases`
[source,js]
--------
client.indices.getAliases([params, [callback]])
--------
Retrieve specified aliases
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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 operation timeout
`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 filter
link:#[back to top]
[[api-indices-getfieldmapping-1-7]]
=== `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/1.7/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`includeDefaults`::
<<api-param-type-boolean,`Boolean`>> -- Whether the default mapping values should be returned as well
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types
`field`::
<<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-1-7]]
=== `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/1.7/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names
`type`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of document types
link:#[back to top]
[[api-indices-getsettings-1-7]]
=== `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/1.7/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open,closed]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`local`::
<<api-param-type-boolean,`Boolean`>> -- Return local information, do not retrieve the state from master node (default: false)
`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-1-7]]
=== `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/1.7/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`>> -- The name of the template
link:#[back to top]
[[api-indices-getupgrade-1-7]]
=== `indices.getUpgrade`
[source,js]
--------
client.indices.getUpgrade([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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"`
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`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-getwarmer-1-7]]
=== `indices.getWarmer`
[source,js]
--------
client.indices.getWarmer([params, [callback]])
--------
Retreieve an index warmer.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-warmers.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 to restrict the operation; use `_all` 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 warmer (supports wildcards); leave empty to get all warmers
`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
link:#[back to top]
[[api-indices-open-1-7]]
=== `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/1.7/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=closed]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`index`::
<<api-param-type-string,`String`>> -- 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/1.7/indices-open-close.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-optimize-1-7]]
=== `indices.optimize`
[source,js]
--------
client.indices.optimize([params, [callback]])
--------
Explicitly optimize one or more indices.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-optimize.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`flush`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the index should be flushed after performing the operation (default: true)
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`maxNumSegments`::
<<api-param-type-number,`Number`>> -- The number of segments the index should be merged into (default: dynamic)
`onlyExpungeDeletes`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the operation should only expunge deleted documents
`operationThreading`::
anything -- TODO: ?
`waitForMerge`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the request should block until the merge process is finished (default: true)
`force`::
<<api-param-type-boolean,`Boolean`>> -- Force a merge operation to run, even if there is a single segment in the index (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`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-optimize.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-putalias-1-7]]
=== `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/1.7/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/1.7/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-putmapping-1-7]]
=== `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/1.7/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`ignoreConflicts`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether to ignore conflicts while updating the mapping (default: false)
`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/1.7/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-putsettings-1-7]]
=== `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/1.7/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
`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/1.7/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-puttemplate-1-7]]
=== `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/1.7/indices-templates.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`order`::
<<api-param-type-number,`Number`>> -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
`create`::
<<api-param-type-boolean,`Boolean`>> -- Whether the index template should only be added if new or can also replace an existing one
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`masterTimeout`::
<<api-param-type-duration-string,`DurationString`>> -- Specify timeout for connection to master
`flatSettings`::
<<api-param-type-boolean,`Boolean`>> -- Return settings in flat format (default: false)
`name`::
<<api-param-type-string,`String`>> -- The name of the template
`body`::
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-putwarmer-1-7]]
=== `indices.putWarmer`
[source,js]
--------
client.indices.putWarmer([params, [callback]])
--------
Create an index warmer to run registered search requests to warm up the index before it is available for search.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-warmers.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) in the search request to warm
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices in the search request to warm. (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, in the search request to warm.
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 register the warmer for; use `_all` or omit to perform the operation on all indices
`name`::
<<api-param-type-string,`String`>> -- The name of the warmer
`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 register the warmer for; 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/1.7/indices-warmers.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-recovery-1-7]]
=== `indices.recovery`
[source,js]
--------
client.indices.recovery([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`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-1-7]]
=== `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/1.7/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"`
`force`::
<<api-param-type-boolean,`Boolean`>> -- Force a refresh even if not required
`operationThreading`::
anything -- TODO: ?
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`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/1.7/indices-refresh.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-segments-1-7]]
=== `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/1.7/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"`
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`operationThreading`::
anything -- TODO: ?
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
link:#[back to top]
[[api-indices-stats-1-7]]
=== `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/1.7/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
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`[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
`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-status-1-7]]
=== `indices.status`
[source,js]
--------
client.indices.status([params, [callback]])
--------
Get a comprehensive status information of one or more indices.
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-status.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"`
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`operationThreading`::
anything -- TODO: ?
`recovery`::
<<api-param-type-boolean,`Boolean`>> -- Return information about shard recovery
`snapshot`::
<<api-param-type-boolean,`Boolean`>> -- TODO: ?
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
link:#[back to top]
[[api-indices-updatealiases-1-7]]
=== `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/1.7/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/1.7/indices-aliases.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-upgrade-1-7]]
=== `indices.upgrade`
[source,js]
--------
client.indices.upgrade([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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: true)
`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/1.7/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-indices-validatequery-1-7]]
=== `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/1.7/search-validate.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`explain`::
<<api-param-type-boolean,`Boolean`>> -- Return detailed information about the error
`ignoreUnavailable`::
<<api-param-type-boolean,`Boolean`>> -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
<<api-param-type-boolean,`Boolean`>> -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
`[expandWildcards=open]`::
<<api-param-type-string,`String`>> -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
Options:::
* `"open"`
* `"closed"`
* `"none"`
* `"all"`
`operationThreading`::
anything -- TODO: ?
`q`::
<<api-param-type-string,`String`>> -- Query in the Lucene query string syntax
`analyzer`::
<<api-param-type-string,`String`>> -- The analyzer to use for the query string
`analyzeWildcard`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether wildcard and prefix queries should be analyzed (default: false)
`[defaultOperator=OR]`::
<<api-param-type-string,`String`>> -- The default operator for query string query (AND or OR)
Options:::
* `"AND"`
* `"OR"`
`df`::
<<api-param-type-string,`String`>> -- The field to use as default where no field prefix is given in the query string
`lenient`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
`lowercaseExpandedTerms`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether query terms should be lowercased
`rewrite`::
<<api-param-type-boolean,`Boolean`>> -- Provide a more detailed explanation showing the actual Lucene query that will be executed.
`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/1.7/search-validate.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-nodes-hotthreads-1-7]]
=== `nodes.hotThreads`
[source,js]
--------
client.nodes.hotThreads([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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-1-7]]
=== `nodes.info`
[source,js]
--------
client.nodes.info([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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)
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`timeout`::
<<api-param-type-duration-string,`DurationString`>> -- Explicit operation timeout
`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-shutdown-1-7]]
=== `nodes.shutdown`
[source,js]
--------
client.nodes.shutdown([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-nodes-shutdown.html[the elasticsearch docs] for more information pertaining to this method.
// no examples
*Params*
[horizontal]
`delay`::
<<api-param-type-duration-string,`DurationString`>> -- Set the delay for the operation (default: 1s)
`exit`::
<<api-param-type-boolean,`Boolean`>> -- Exit the JVM as well (default: true)
`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 perform the operation on; use `_local` to perform the operation on the node you're connected to, leave empty to perform the operation on all 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/1.7/cluster-nodes-shutdown.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-nodes-stats-1-7]]
=== `nodes.stats`
[source,js]
--------
client.nodes.stats([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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
`human`::
<<api-param-type-boolean,`Boolean`>> -- Whether to return time and byte values in human-readable format.
`[level=node]`::
<<api-param-type-string,`String`>> -- Return indices stats aggregated at node, index or shard level
Options:::
* `"node"`
* `"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
`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
`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-snapshot-create-1-7]]
=== `snapshot.create`
[source,js]
--------
client.snapshot.create([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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/1.7/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-createrepository-1-7]]
=== `snapshot.createRepository`
[source,js]
--------
client.snapshot.createRepository([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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/1.7/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-delete-1-7]]
=== `snapshot.delete`
[source,js]
--------
client.snapshot.delete([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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/1.7/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-deleterepository-1-7]]
=== `snapshot.deleteRepository`
[source,js]
--------
client.snapshot.deleteRepository([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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/1.7/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-get-1-7]]
=== `snapshot.get`
[source,js]
--------
client.snapshot.get([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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`>>, <<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-1-7]]
=== `snapshot.getRepository`
[source,js]
--------
client.snapshot.getRepository([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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-1-7]]
=== `snapshot.restore`
[source,js]
--------
client.snapshot.restore([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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/1.7/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]
[[api-snapshot-status-1-7]]
=== `snapshot.status`
[source,js]
--------
client.snapshot.status([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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`>>, <<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-1-7]]
=== `snapshot.verifyRepository`
[source,js]
--------
client.snapshot.verifyRepository([params, [callback]])
--------
// no description
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/1.7/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/1.7/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here.
link:#[back to top]