From 6bff09108bafebb9b417e5439c33b503e227adf9 Mon Sep 17 00:00:00 2001 From: spalger Date: Wed, 26 Oct 2016 17:52:54 -0700 Subject: [PATCH] [api] regenerate --- docs/api_methods.asciidoc | 1392 ++++--- docs/api_methods_0_90.asciidoc | 14 +- docs/api_methods_1_7.asciidoc | 20 +- docs/api_methods_2_3.asciidoc | 4924 ++++++++++++++++++++++ docs/api_methods_2_4.asciidoc | 4953 ++++++++++++++++++++++ docs/configuration.asciidoc | 12 +- docs/index.asciidoc | 4 + package.json | 8 +- src/lib/apis/0_90.js | 28 +- src/lib/apis/1_7.js | 36 +- src/lib/apis/2_4.js | 71 +- src/lib/apis/5_0.js | 7116 +++++++++++++++++++++++++++++++ src/lib/apis/5_x.js | 7160 ++++++++++++++++++++++++++++++++ src/lib/apis/browser_index.js | 8 +- src/lib/apis/index.js | 6 +- src/lib/apis/master.js | 519 ++- 16 files changed, 25475 insertions(+), 796 deletions(-) create mode 100644 docs/api_methods_2_3.asciidoc create mode 100644 docs/api_methods_2_4.asciidoc create mode 100644 src/lib/apis/5_0.js create mode 100644 src/lib/apis/5_x.js diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index 6a4107dbd..d93c87a3a 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -1,5 +1,5 @@ [[api-reference]] -== 2.3 API +== 5.0 API NOTE: This is currently the default API, but in upcoming versions that will change. We recommend setting the `apiVersion` config param when you instantiate your client to make sure that the API does not change unexpectedly. @@ -15,7 +15,7 @@ client.bulk([params, [callback]]) Perform many index/delete operations in a single API call. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-bulk.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html[the elasticsearch docs] for more about this method. .Perform three operations in a single request [source,js] @@ -43,15 +43,16 @@ client.bulk({ *Params* [horizontal] -`consistency`:: -`String` -- Explicit write consistency setting for the operation -Options::: - * `"one"` - * `"quorum"` - * `"all"` - +`waitForActiveShards`:: +`String` -- Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) `refresh`:: -`Boolean` -- Refresh the index after performing the operation +`String` -- If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. +Options::: + * `"true"` + * `"false"` + * `"wait_for"` + * `""` + `routing`:: `String` -- Specific routing value `timeout`:: @@ -59,7 +60,15 @@ Options::: `type`:: `String` -- Default document type for items which don't provide one `fields`:: -`String, String[], Boolean` -- Default comma-separated list of fields to return in the response for updates +`String, String[], Boolean` -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request +`_sourceExclude`:: +`String, String[], Boolean` -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request +`_sourceInclude`:: +`String, String[], Boolean` -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request +`pipeline`:: +`String` -- The pipeline id to preprocess incoming documents with `index`:: `String` -- Default index for items which don't provide one @@ -75,7 +84,7 @@ client.clearScroll([params, [callback]]) Clear the scroll request created by specifying the scroll parameter to search. -The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-request-scroll.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html[the elasticsearch docs] for more about this method. // no examples @@ -98,7 +107,7 @@ client.count([params, [callback]]) Get the number of documents for the cluster, index, type, or a query. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-count.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html[the elasticsearch docs] for more about this method. .Get the number of all documents in the cluster [source,js] @@ -198,7 +207,7 @@ client.countPercolate([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-percolate.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html[the elasticsearch docs] for more about this method. // no examples @@ -255,7 +264,7 @@ 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. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-index_.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html[the elasticsearch docs] for more about this method. .Create a document [source,js] @@ -280,17 +289,18 @@ client.create({ *Params* [horizontal] -`consistency`:: -`String` -- Explicit write consistency setting for the operation -Options::: - * `"one"` - * `"quorum"` - * `"all"` - +`waitForActiveShards`:: +`String` -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) `parent`:: `String` -- ID of the parent document `refresh`:: -`Boolean` -- Refresh the index after performing the operation +`String` -- If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. +Options::: + * `"true"` + * `"false"` + * `"wait_for"` + * `""` + `routing`:: `String` -- Specific routing value `timeout`:: @@ -298,7 +308,7 @@ Options::: `timestamp`:: `Date, Number` -- Explicit timestamp for the document `ttl`:: -`Duration` -- Expiration time for the document +`Date, Number` -- Expiration time for the document `version`:: `Number` -- Explicit version number for concurrency control `versionType`:: @@ -309,6 +319,84 @@ Options::: * `"external_gte"` * `"force"` +`pipeline`:: +`String` -- The pipeline id to preprocess incoming documents with +`id`:: +`String` -- Document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-create]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html[the elasticsearch docs] for more about this method. + +.Create a document +[source,js] +--------- +client.create({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + title: 'Test 1', + tags: ['y', 'z'], + published: true, + published_at: '2013-01-01', + counter: 1 + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`waitForActiveShards`:: +`String` -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) +`parent`:: +`String` -- ID of the parent document +`refresh`:: +`String` -- If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. +Options::: + * `"true"` + * `"false"` + * `"wait_for"` + * `""` + +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`timestamp`:: +`Date, Number` -- Explicit timestamp for the document +`ttl`:: +`Date, Number` -- Expiration time for the document +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`pipeline`:: +`String` -- The pipeline id to preprocess incoming documents with `id`:: `String` -- Document ID `index`:: @@ -328,7 +416,7 @@ client.delete([params, [callback]]) Delete a typed JSON document from a specific index based on its id. -The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-delete.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html[the elasticsearch docs] for more about this method. .Delete the document `/myindex/mytype/1` [source,js] @@ -346,17 +434,18 @@ client.delete({ *Params* [horizontal] -`consistency`:: -`String` -- Specific write consistency setting for the operation -Options::: - * `"one"` - * `"quorum"` - * `"all"` - +`waitForActiveShards`:: +`String` -- Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) `parent`:: `String` -- ID of parent document `refresh`:: -`Boolean` -- Refresh the index after performing the operation +`String` -- If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. +Options::: + * `"true"` + * `"false"` + * `"wait_for"` + * `""` + `routing`:: `String` -- Specific routing value `timeout`:: @@ -380,6 +469,158 @@ Options::: link:#[back to top] +[[api-deletebyquery]] +=== `deleteByQuery` + +[source,js] +-------- +client.deleteByQuery([params, [callback]]) +-------- + +Delete documents from one or more indices and one or more types based on a query. + +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html[the elasticsearch docs] for more about this method. + +.Deleting documents with a simple query +[source,js] +--------- +client.deleteByQuery({ + index: 'myindex', + q: 'test' +}, function (error, response) { + // ... +}); +--------- + +.Deleting documents using the Query DSL +[source,js] +--------- +client.deleteByQuery({ + index: 'posts', + body: { + query: { + term: { published: false } + } + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`explain`:: +`Boolean` -- Specify whether to return detailed information about score computation as part of a hit +`storedFields`:: +`String, String[], Boolean` -- A comma-separated list of stored fields to return as part of a hit +`docvalueFields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as the docvalue representation of a field for each hit +`from`:: +`Number` -- Starting offset (default: 0) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[conflicts=abort]`:: +`String` -- What to do when the delete-by-query hits version conflicts? +Options::: + * `"abort"` + * `"proceed"` + +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`q`:: +`String` -- Query in the Lucene query string syntax +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`scroll`:: +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"dfs_query_then_fetch"` + +`searchTimeout`:: +`Date, Number` -- Explicit timeout for each search request. Defaults to no timeout. +`size`:: +`Number` -- Number of hits to return (default: 10) +`sort`:: +`String, String[], Boolean` -- A comma-separated list of : pairs +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`terminateAfter`:: +`Number` -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. +`stats`:: +`String, String[], Boolean` -- Specific 'tag' of the request for logging and statistical purposes +`suggestField`:: +`String` -- Specify which field to use for suggestions +`[suggestMode=missing]`:: +`String` -- Specify suggest mode +Options::: + * `"missing"` + * `"popular"` + * `"always"` + +`suggestSize`:: +`Number` -- How many suggestions to return in response +`suggestText`:: +`String` -- The source text for which the suggestions should be returned +`[timeout=1m]`:: +`Date, Number` -- Time each individual bulk request should wait for shards that are unavailable. +`trackScores`:: +`Boolean` -- Whether to calculate and return scores even if they are not used for sorting +`version`:: +`Boolean` -- Specify whether to return document version as part of a hit +`requestCache`:: +`Boolean` -- Specify if request cache should be used for this request or not, defaults to index level setting +`refresh`:: +`Boolean` -- Should the effected indexes be refreshed? +`waitForActiveShards`:: +`String` -- Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) +`scrollSize`:: +`Number` -- Size on the scroll request powering the update_by_query +`waitForCompletion`:: +`Boolean` -- Should the request should block until the delete-by-query is complete. +`requestsPerSecond`:: +`Number` -- The throttle for this request in sub-requests per second. -1 means set no throttle. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + [[api-deletescript]] === `deleteScript` @@ -390,7 +631,7 @@ client.deleteScript([params, [callback]]) // no description -The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html[the elasticsearch docs] for more about this method. // no examples @@ -398,16 +639,6 @@ The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-template.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html[the elasticsearch docs] for more about this method. // no examples @@ -433,16 +664,6 @@ The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-get.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html[the elasticsearch docs] for more about this method. .Check that the document `/myindex/mytype/1` exist [source,js] @@ -509,7 +730,7 @@ client.explain([params, [callback]]) Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. Also check out http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html[percolaters]. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-explain.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html[the elasticsearch docs] for more about this method. .See how a document is scored against a simple query [source,js] @@ -560,8 +781,8 @@ Options::: `df`:: `String` -- The default field for query string query (default: _all) -`fields`:: -`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`storedFields`:: +`String, String[], Boolean` -- A comma-separated list of stored fields to return in the response `lenient`:: `Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored `lowercaseExpandedTerms`:: @@ -599,7 +820,7 @@ client.fieldStats([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-field-stats.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-stats.html[the elasticsearch docs] for more about this method. // no examples @@ -642,7 +863,7 @@ client.get([params, [callback]]) Get a typed JSON document from the index based on its id. -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-get.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html[the elasticsearch docs] for more about this method. .Get `/myindex/mytype/1` [source,js] @@ -660,8 +881,8 @@ client.get({ *Params* [horizontal] -`fields`:: -`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`storedFields`:: +`String, String[], Boolean` -- A comma-separated list of stored fields to return in the response `parent`:: `String` -- The ID of the parent document `preference`:: @@ -707,7 +928,7 @@ client.getScript([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html[the elasticsearch docs] for more about this method. // no examples @@ -715,16 +936,6 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-get.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html[the elasticsearch docs] for more about this method. // no examples @@ -796,7 +1007,7 @@ client.getTemplate([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-template.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html[the elasticsearch docs] for more about this method. // no examples @@ -804,16 +1015,6 @@ The default method is `GET` and the usual <>. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-index_.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html[the elasticsearch docs] for more about this method. .Create or update a document [source,js] @@ -857,17 +1058,18 @@ client.index({ *Params* [horizontal] -`consistency`:: -`String` -- Explicit write consistency setting for the operation -Options::: - * `"one"` - * `"quorum"` - * `"all"` - +`waitForActiveShards`:: +`String` -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) `parent`:: `String` -- ID of the parent document `refresh`:: -`Boolean` -- Refresh the index after performing the operation +`String` -- If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. +Options::: + * `"true"` + * `"false"` + * `"wait_for"` + * `""` + `routing`:: `String` -- Specific routing value `timeout`:: @@ -875,7 +1077,7 @@ Options::: `timestamp`:: `Date, Number` -- Explicit timestamp for the document `ttl`:: -`Duration` -- Expiration time for the document +`Date, Number` -- Expiration time for the document `version`:: `Number` -- Explicit version number for concurrency control `versionType`:: @@ -886,6 +1088,8 @@ Options::: * `"external_gte"` * `"force"` +`pipeline`:: +`String` -- The pipeline id to preprocess incoming documents with `id`:: `String` -- Document ID `index`:: @@ -921,7 +1125,7 @@ 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. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-multi-get.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html[the elasticsearch docs] for more about this method. .An array of doc locations. Useful for getting documents from different indices. [source,js] @@ -957,8 +1161,8 @@ client.mget({ *Params* [horizontal] -`fields`:: -`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`storedFields`:: +`String, String[], Boolean` -- A comma-separated list of stored fields to return in the response `preference`:: `String` -- Specify the node or shard the operation should be performed on (default: random) `realtime`:: @@ -988,7 +1192,7 @@ client.mpercolate([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-percolate.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html[the elasticsearch docs] for more about this method. // no examples @@ -1025,7 +1229,7 @@ client.msearch([params, [callback]]) Execute several search requests within the same request. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-multi-search.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html[the elasticsearch docs] for more about this method. .Perform multiple different searches, the body is made up of meta/data pairs [source,js] @@ -1055,8 +1259,41 @@ Options::: * `"query_and_fetch"` * `"dfs_query_then_fetch"` * `"dfs_query_and_fetch"` - * `"count"` - * `"scan"` + +`maxConcurrentSearches`:: +`Number` -- Controls the maximum number of concurrent searches the multi search api will execute +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to use as default +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to use as default + +link:#[back to top] + +[[api-msearchtemplate]] +=== `msearchTemplate` + +[source,js] +-------- +client.msearchTemplate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"query_and_fetch"` + * `"dfs_query_then_fetch"` + * `"dfs_query_and_fetch"` `index`:: `String, String[], Boolean` -- A comma-separated list of index names to use as default @@ -1075,7 +1312,7 @@ client.mtermvectors([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-multi-termvectors.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html[the elasticsearch docs] for more about this method. // no examples @@ -1132,7 +1369,7 @@ client.percolate([params, [callback]]) Match a document against registered percolator queries. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-percolate.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html[the elasticsearch docs] for more about this method. .First, Register queries named “alert-1” and “alert-2” for the “myindex” index [source,js] @@ -1287,7 +1524,7 @@ client.putScript([params, [callback]]) // no description -The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html[the elasticsearch docs] for more about this method. // no examples @@ -1295,22 +1532,6 @@ The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-template.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html[the elasticsearch docs] for more about this method. // no examples @@ -1336,22 +1557,6 @@ The default method is `PUT` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-reindex.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html[the elasticsearch docs] for more about this method. // no examples @@ -1379,15 +1584,37 @@ The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`requestsPerSecond`:: +`Number` -- The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. +`taskId`:: +`String` -- The task id to rethrottle link:#[back to top] @@ -1401,7 +1628,7 @@ client.renderSearchTemplate([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/2.3/search-template.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html[the elasticsearch docs] for more about this method. // no examples @@ -1424,7 +1651,7 @@ client.scroll([params, [callback]]) Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-request-scroll.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html[the elasticsearch docs] for more about this method. .Collect every title in the index that contains the word "test" [source,js] @@ -1463,7 +1690,7 @@ client.search({ [horizontal] `scroll`:: -`Duration` -- Specify how long a consistent view of the index should be maintained for scrolled search +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search `scrollId`:: `String` -- The scroll ID @@ -1483,7 +1710,7 @@ TIP: https://github.com/fullscale/elastic.js[elastic.js], https://github.com/hol -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-search.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html[the elasticsearch docs] for more about this method. .Search with a simple query string query [source,js] @@ -1538,10 +1765,12 @@ Options::: `String` -- The field to use as default where no field prefix is given in the query string `explain`:: `Boolean` -- Specify whether to return detailed information about score computation as part of a hit -`fields`:: -`String, String[], Boolean` -- A comma-separated list of fields to return as part of a hit +`storedFields`:: +`String, String[], Boolean` -- A comma-separated list of stored fields to return as part of a hit +`docvalueFields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as the docvalue representation of a field for each hit `fielddataFields`:: -`String, String[], Boolean` -- A comma-separated list of fields to return as the field data representation of a field for each hit +`String, String[], Boolean` -- A comma-separated list of fields to return as the docvalue representation of a field for each hit `from`:: `Number` -- Starting offset (default: 0) `ignoreUnavailable`:: @@ -1567,14 +1796,12 @@ Options::: `routing`:: `String, String[], Boolean` -- A comma-separated list of specific routing values `scroll`:: -`Duration` -- Specify how long a consistent view of the index should be maintained for scrolled search +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search `searchType`:: `String` -- Search operation type Options::: * `"query_then_fetch"` * `"dfs_query_then_fetch"` - * `"count"` - * `"scan"` `size`:: `Number` -- Number of hits to return (default: 10) @@ -1602,7 +1829,7 @@ Options::: `suggestSize`:: `Number` -- How many suggestions to return in response `suggestText`:: -`Text` -- The source text for which the suggestions should be returned +`String` -- The source text for which the suggestions should be returned `timeout`:: `Date, Number` -- Explicit operation timeout `trackScores`:: @@ -1618,67 +1845,6 @@ Options::: link:#[back to top] -[[api-searchexists]] -=== `searchExists` - -[source,js] --------- -client.searchExists([params, [callback]]) --------- - -// no description - -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-exists.html[the elasticsearch docs] for more about this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`allowNoIndices`:: -`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -`[expandWildcards=open]`:: -`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`minScore`:: -`Number` -- Include only documents with a specific `_score` value in the result -`preference`:: -`String` -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -`String` -- Specific routing value -`q`:: -`String` -- Query in the Lucene query string syntax -`analyzer`:: -`String` -- The analyzer to use for the query string -`analyzeWildcard`:: -`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -`String` -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -`String` -- The field to use as default where no field prefix is given in the query string -`lenient`:: -`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`lowercaseExpandedTerms`:: -`Boolean` -- Specify whether query terms should be lowercased -`index`:: -`String, String[], Boolean` -- A comma-separated list of indices to restrict the results -`type`:: -`String, String[], Boolean` -- A comma-separated list of types to restrict the results - -link:#[back to top] - [[api-searchshards]] === `searchShards` @@ -1689,7 +1855,7 @@ client.searchShards([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-shards.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html[the elasticsearch docs] for more about this method. // no examples @@ -1757,7 +1923,7 @@ Options::: `routing`:: `String, String[], Boolean` -- A comma-separated list of specific routing values `scroll`:: -`Duration` -- Specify how long a consistent view of the index should be maintained for scrolled search +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search `searchType`:: `String` -- Search operation type Options::: @@ -1765,8 +1931,6 @@ Options::: * `"query_and_fetch"` * `"dfs_query_then_fetch"` * `"dfs_query_and_fetch"` - * `"count"` - * `"scan"` `index`:: `String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -1785,7 +1949,7 @@ client.suggest([params, [callback]]) The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-suggesters.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-suggesters.html[the elasticsearch docs] for more about this method. .Return query terms suggestions (“auto-correction”) [source,js] @@ -1857,7 +2021,7 @@ client.termvectors([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-termvectors.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html[the elasticsearch docs] for more about this method. // no examples @@ -1869,8 +2033,6 @@ The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-update.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html[the elasticsearch docs] for more about this method. .Update document title using partial document [source,js] @@ -1995,37 +2157,38 @@ client.update({ *Params* [horizontal] -`consistency`:: -`String` -- Explicit write consistency setting for the operation -Options::: - * `"one"` - * `"quorum"` - * `"all"` - +`waitForActiveShards`:: +`String` -- Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) `fields`:: `String, String[], Boolean` -- A comma-separated list of fields to return in the response +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field `lang`:: `String` -- The script language (default: groovy) `parent`:: `String` -- ID of the parent document. Is is only used for routing and when for the upsert request `refresh`:: -`Boolean` -- Refresh the index after performing the operation +`String` -- If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. +Options::: + * `"true"` + * `"false"` + * `"wait_for"` + * `""` + `retryOnConflict`:: `Number` -- Specify how many times should the operation be retried when a conflict occurs (default: 0) `routing`:: `String` -- Specific routing value -`script`:: -`Anything` -- The URL-encoded script definition (instead of using request body) -`scriptId`:: -`Anything` -- The id of a stored script -`scriptedUpsert`:: -`Boolean` -- True if the script referenced in script or script_id should be called to perform inserts - defaults to false `timeout`:: `Date, Number` -- Explicit operation timeout `timestamp`:: `Date, Number` -- Explicit timestamp for the document `ttl`:: -`Duration` -- Expiration time for the document +`Date, Number` -- Expiration time for the document `version`:: `Number` -- Explicit version number for concurrency control `versionType`:: @@ -2053,7 +2216,7 @@ client.updateByQuery([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-update-by-query.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html[the elasticsearch docs] for more about this method. // no examples @@ -2075,10 +2238,12 @@ Options::: `String` -- The field to use as default where no field prefix is given in the query string `explain`:: `Boolean` -- Specify whether to return detailed information about score computation as part of a hit -`fields`:: -`String, String[], Boolean` -- A comma-separated list of fields to return as part of a hit +`storedFields`:: +`String, String[], Boolean` -- A comma-separated list of stored fields to return as part of a hit +`docvalueFields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as the docvalue representation of a field for each hit `fielddataFields`:: -`String, String[], Boolean` -- A comma-separated list of fields to return as the field data representation of a field for each hit +`String, String[], Boolean` -- A comma-separated list of fields to return as the docvalue representation of a field for each hit `from`:: `Number` -- Starting offset (default: 0) `ignoreUnavailable`:: @@ -2103,6 +2268,8 @@ Options::: `Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored `lowercaseExpandedTerms`:: `Boolean` -- Specify whether query terms should be lowercased +`pipeline`:: +`String` -- Ingest pipeline to set on index requests made by this action. (default: none) `preference`:: `String` -- Specify the node or shard the operation should be performed on (default: random) `q`:: @@ -2110,7 +2277,7 @@ Options::: `routing`:: `String, String[], Boolean` -- A comma-separated list of specific routing values `scroll`:: -`Duration` -- Specify how long a consistent view of the index should be maintained for scrolled search +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search `searchType`:: `String` -- Search operation type Options::: @@ -2145,7 +2312,7 @@ Options::: `suggestSize`:: `Number` -- How many suggestions to return in response `suggestText`:: -`Text` -- The source text for which the suggestions should be returned +`String` -- The source text for which the suggestions should be returned `[timeout=1m]`:: `Date, Number` -- Time each individual bulk request should wait for shards that are unavailable. `trackScores`:: @@ -2158,17 +2325,14 @@ Options::: `Boolean` -- Specify if request cache should be used for this request or not, defaults to index level setting `refresh`:: `Boolean` -- Should the effected indexes be refreshed? -`consistency`:: -`String` -- Explicit write consistency setting for the operation -Options::: - * `"one"` - * `"quorum"` - * `"all"` - +`waitForActiveShards`:: +`String` -- Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) `scrollSize`:: -`Integer` -- Size on the scroll request powering the update_by_query +`Number` -- Size on the scroll request powering the update_by_query `waitForCompletion`:: `Boolean` -- Should the request should block until the reindex is complete. +`requestsPerSecond`:: +`Number` -- The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. `index`:: `String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `type`:: @@ -2194,6 +2358,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-allocation.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html[the elasticsearch docs] for more about this method. // no examples @@ -2227,13 +2393,22 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-count.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html[the elasticsearch docs] for more about this method. // no examples @@ -2268,6 +2443,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-fielddata.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html[the elasticsearch docs] for more about this method. // no examples @@ -2301,13 +2478,22 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-health.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html[the elasticsearch docs] for more about this method. // no examples @@ -2342,6 +2528,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html[the elasticsearch docs] for more about this method. // no examples @@ -2390,7 +2578,7 @@ client.cat.indices([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-indices.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html[the elasticsearch docs] for more about this method. // no examples @@ -2398,6 +2586,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-master.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html[the elasticsearch docs] for more about this method. // no examples @@ -2441,6 +2638,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-nodeattrs.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html[the elasticsearch docs] for more about this method. // no examples @@ -2472,6 +2671,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-nodes.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html[the elasticsearch docs] for more about this method. // no examples @@ -2503,6 +2704,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-pending-tasks.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html[the elasticsearch docs] for more about this method. // no examples @@ -2534,6 +2737,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-plugins.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html[the elasticsearch docs] for more about this method. // no examples @@ -2565,6 +2770,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-recovery.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html[the elasticsearch docs] for more about this method. // no examples @@ -2596,13 +2803,22 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-repositories.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html[the elasticsearch docs] for more about this method. // no examples @@ -2635,6 +2851,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-segments.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html[the elasticsearch docs] for more about this method. // no examples @@ -2666,6 +2884,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-shards.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html[the elasticsearch docs] for more about this method. // no examples @@ -2695,6 +2915,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -2728,6 +2950,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`format`:: +`String` -- a short version of the Accept header, e.g. json, yaml +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes +`actions`:: +`String, String[], Boolean` -- A comma-separated list of actions that should be returned. Leave empty to return all. +`detailed`:: +`Boolean` -- Return detailed task information (default: false) +`parentNode`:: +`String` -- Return tasks with specified parent node. +`parentTask`:: +`Number` -- Return tasks with specified parent task id. Set to -1 to return all. +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + [[api-cat-threadpool]] === `cat.threadPool` @@ -2753,7 +3016,7 @@ client.cat.threadPool([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-thread-pool.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html[the elasticsearch docs] for more about this method. // no examples @@ -2761,6 +3024,18 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`includeYesDecisions`:: +`Boolean` -- Return 'YES' decisions in explanation (default: false) +`includeDiskInfo`:: +`Boolean` -- Return information about disk usage and shard sizes (default: false) link:#[back to top] @@ -2786,7 +3086,7 @@ client.cluster.getSettings([params, [callback]]) Get cluster settings (previously set with `putSettings()`) -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-update-settings.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -2800,6 +3100,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-health.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html[the elasticsearch docs] for more about this method. // no examples @@ -2835,11 +3137,21 @@ Options::: `timeout`:: `Date, Number` -- Explicit operation timeout `waitForActiveShards`:: -`Number` -- Wait until the specified number of shards is active +`String` -- Wait until the specified number of shards is active `waitForNodes`:: `String` -- Wait until the specified number of nodes is available -`waitForRelocatingShards`:: -`Number` -- Wait until the specified number of relocating shards is finished +`waitForEvents`:: +`String` -- Wait until all currently queued events with the given priorty are processed +Options::: + * `"immediate"` + * `"urgent"` + * `"high"` + * `"normal"` + * `"low"` + * `"languid"` + +`waitForNoRelocatingShards`:: +`Boolean` -- Whether to wait until there are no relocating shards in the cluster `waitForStatus`:: `String` -- Wait until cluster is in a specific state Options::: @@ -2862,7 +3174,7 @@ client.cluster.pendingTasks([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-pending.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html[the elasticsearch docs] for more about this method. // no examples @@ -2887,7 +3199,7 @@ client.cluster.putSettings([params, [callback]]) Update cluster wide specific settings. -The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-update-settings.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -2914,7 +3226,7 @@ client.cluster.reroute([params, [callback]]) Explicitly execute a cluster reroute allocation command including specific commands. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-reroute.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html[the elasticsearch docs] for more about this method. // no examples @@ -2926,6 +3238,8 @@ The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-state.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html[the elasticsearch docs] for more about this method. // no examples @@ -2988,7 +3302,7 @@ client.cluster.stats([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-stats.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html[the elasticsearch docs] for more about this method. // no examples @@ -3017,7 +3331,7 @@ client.indices.analyze([params, [callback]]) Perform the analysis process on a text and return the tokens breakdown of the text. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-analyze.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html[the elasticsearch docs] for more about this method. // no examples @@ -3027,14 +3341,10 @@ The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-clearcache.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html[the elasticsearch docs] for more about this method. // no examples @@ -3116,7 +3426,7 @@ client.indices.close([params, [callback]]) Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-open-close.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html[the elasticsearch docs] for more about this method. // no examples @@ -3155,7 +3465,7 @@ client.indices.create([params, [callback]]) Create an index in Elasticsearch. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-create-index.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html[the elasticsearch docs] for more about this method. // no examples @@ -3163,6 +3473,8 @@ The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-delete-index.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html[the elasticsearch docs] for more about this method. // no examples @@ -3211,7 +3523,7 @@ client.indices.deleteAlias([params, [callback]]) Delete a specific alias. -The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -3240,7 +3552,7 @@ client.indices.deleteTemplate([params, [callback]]) Delete an index template by its name. -The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -3257,33 +3569,6 @@ The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-warmers.html[the elasticsearch docs] for more about this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -`Date, Number` -- Specify timeout for connection to master -`name`:: -`String, String[], 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`:: -`String, String[], Boolean` -- A comma-separated list of index names to delete warmers from (supports wildcards); use `_all` to perform the operation on all indices. - -link:#[back to top] - [[api-indices-exists]] === `indices.exists` @@ -3294,7 +3579,7 @@ client.indices.exists([params, [callback]]) Return a boolean indicating whether given index exists. -The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-exists.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html[the elasticsearch docs] for more about this method. // no examples @@ -3331,7 +3616,7 @@ client.indices.existsAlias([params, [callback]]) Return a boolean indicating whether given alias exists. -The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -3370,7 +3655,7 @@ client.indices.existsTemplate([params, [callback]]) // no description -The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -3397,7 +3682,7 @@ client.indices.existsType([params, [callback]]) Check if a type/types exists in an index/indices. -The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-types-exists.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html[the elasticsearch docs] for more about this method. // no examples @@ -3436,7 +3721,7 @@ client.indices.flush([params, [callback]]) Explicitly flush one or more indices. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-flush.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html[the elasticsearch docs] for more about this method. // no examples @@ -3447,7 +3732,7 @@ The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-synced-flush.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html[the elasticsearch docs] for more about this method. // no examples @@ -3510,7 +3795,7 @@ client.indices.forcemerge([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-forcemerge.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html[the elasticsearch docs] for more about this method. // no examples @@ -3555,7 +3840,7 @@ client.indices.get([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-get-index.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html[the elasticsearch docs] for more about this method. // no examples @@ -3581,6 +3866,8 @@ Options::: `Boolean` -- Return settings in flat format (default: false) `human`:: `Boolean` -- Whether to return version and creation date values in human-readable format. +`includeDefaults`:: +`Boolean` -- Whether to return all default setting for each of the indices. `index`:: `String, String[], Boolean` -- A comma-separated list of index names `feature`:: @@ -3598,7 +3885,7 @@ client.indices.getAlias([params, [callback]]) Retrieve a specified alias. -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -3610,7 +3897,7 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -`Date, Number` -- Explicit operation timeout -`local`:: -`Boolean` -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -`String, String[], Boolean` -- A comma-separated list of index names to filter aliases -`name`:: -`String, String[], Boolean` -- A comma-separated list of alias names to filter - -link:#[back to top] - [[api-indices-getfieldmapping]] === `indices.getFieldMapping` @@ -3666,7 +3924,7 @@ client.indices.getFieldMapping([params, [callback]]) Retrieve mapping definition of a specific field. -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-get-field-mapping.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -3709,7 +3967,7 @@ client.indices.getMapping([params, [callback]]) Retrieve mapping definition of index or index/type. -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-get-mapping.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -3748,7 +4006,7 @@ client.indices.getSettings([params, [callback]]) Retrieve settings for one or more (or all) indices. -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-get-settings.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -3774,6 +4032,8 @@ Options::: `Boolean` -- Return local information, do not retrieve the state from master node (default: false) `human`:: `Boolean` -- Whether to return version and creation date values in human-readable format. +`includeDefaults`:: +`Boolean` -- Whether to return all default setting for each of the indices. `index`:: `String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `name`:: @@ -3791,7 +4051,7 @@ client.indices.getTemplate([params, [callback]]) Retrieve an index template by its name. -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -3820,7 +4080,7 @@ client.indices.getUpgrade([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-upgrade.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html[the elasticsearch docs] for more about this method. // no examples @@ -3847,47 +4107,6 @@ Options::: link:#[back to top] -[[api-indices-getwarmer]] -=== `indices.getWarmer` - -[source,js] --------- -client.indices.getWarmer([params, [callback]]) --------- - -Retreieve an index warmer. - -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-warmers.html[the elasticsearch docs] for more about this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`allowNoIndices`:: -`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -`[expandWildcards=open]`:: -`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -`Boolean` -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -`String, String[], Boolean` -- A comma-separated list of index names to restrict the operation; use `_all` to perform the operation on all indices -`name`:: -`String, String[], Boolean` -- The name of the warmer (supports wildcards); leave empty to get all warmers -`type`:: -`String, String[], 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]] === `indices.open` @@ -3898,7 +4117,7 @@ client.indices.open([params, [callback]]) Open a closed index, making it available for search. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-open-close.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html[the elasticsearch docs] for more about this method. // no examples @@ -3927,51 +4146,6 @@ Options::: link:#[back to top] -[[api-indices-optimize]] -=== `indices.optimize` - -[source,js] --------- -client.indices.optimize([params, [callback]]) --------- - -Explicitly optimize one or more indices. - -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-optimize.html[the elasticsearch docs] for more about this method. - -// no examples - - -*Params* - -[horizontal] -`flush`:: -`Boolean` -- Specify whether the index should be flushed after performing the operation (default: true) -`ignoreUnavailable`:: -`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`allowNoIndices`:: -`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -`[expandWildcards=open]`:: -`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`maxNumSegments`:: -`Number` -- The number of segments the index should be merged into (default: dynamic) -`onlyExpungeDeletes`:: -`Boolean` -- Specify whether the operation should only expunge deleted documents -`operationThreading`:: -`Anything` -- TODO: ? -`waitForMerge`:: -`Boolean` -- Specify whether the request should block until the merge process is finished (default: true) -`index`:: -`String, String[], 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-putalias]] === `indices.putAlias` @@ -3982,7 +4156,7 @@ client.indices.putAlias([params, [callback]]) Create an alias for a specific index/indices. -The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -4011,7 +4185,7 @@ client.indices.putMapping([params, [callback]]) Register specific mapping definition for a specific type. -The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-put-mapping.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -4054,7 +4228,7 @@ client.indices.putSettings([params, [callback]]) Change specific index level settings in real time. -The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-update-settings.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -4064,6 +4238,8 @@ The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -4116,49 +4292,6 @@ The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-warmers.html[the elasticsearch docs] for more about this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -`Date, Number` -- Specify timeout for connection to master -`ignoreUnavailable`:: -`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) in the search request to warm -`allowNoIndices`:: -`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]`:: -`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"` - -`requestCache`:: -`Boolean` -- Specify whether the request to be warmed should use the request cache, defaults to index level setting -`index`:: -`String, String[], 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`:: -`String` -- The name of the warmer -`type`:: -`String, String[], Boolean` -- A comma-separated list of document types to register the warmer for; leave empty to perform the operation on all types - -link:#[back to top] - [[api-indices-recovery]] === `indices.recovery` @@ -4169,7 +4302,7 @@ client.indices.recovery([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-recovery.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html[the elasticsearch docs] for more about this method. // no examples @@ -4198,7 +4331,7 @@ client.indices.refresh([params, [callback]]) Explicitly refresh one or more index, making all operations performed since the last refresh available for search. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-refresh.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html[the elasticsearch docs] for more about this method. // no examples @@ -4227,6 +4360,37 @@ Options::: link:#[back to top] +[[api-indices-rollover]] +=== `indices.rollover` + +[source,js] +-------- +client.indices.rollover([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`waitForActiveShards`:: +`String` -- Set the number of active shards to wait for on the newly created rollover index before the operation returns. +`alias`:: +`String` -- The name of the alias to rollover +`newIndex`:: +`String` -- The name of the rollover index + +link:#[back to top] + [[api-indices-segments]] === `indices.segments` @@ -4237,7 +4401,7 @@ client.indices.segments([params, [callback]]) Retrieve low level segments information that a Lucene index (shard level) is built with. -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-segments.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html[the elasticsearch docs] for more about this method. // no examples @@ -4278,7 +4442,7 @@ client.indices.shardStores([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-shards-stores.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html[the elasticsearch docs] for more about this method. // no examples @@ -4307,6 +4471,37 @@ Options::: link:#[back to top] +[[api-indices-shrink]] +=== `indices.shrink` + +[source,js] +-------- +client.indices.shrink([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`waitForActiveShards`:: +`String` -- Set the number of active shards to wait for on the shrunken index before the operation returns. +`index`:: +`String` -- The name of the source index to shrink +`target`:: +`String` -- The name of the target index to shrink into + +link:#[back to top] + [[api-indices-stats]] === `indices.stats` @@ -4317,7 +4512,7 @@ client.indices.stats([params, [callback]]) Retrieve statistics on different operations happening on an index. -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-stats.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html[the elasticsearch docs] for more about this method. // no examples @@ -4361,7 +4556,7 @@ client.indices.updateAliases([params, [callback]]) Update specified aliases. -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. .Perform an atomic alias swap, for a rotating index [source,js] @@ -4399,7 +4594,7 @@ client.indices.upgrade([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-upgrade.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html[the elasticsearch docs] for more about this method. // no examples @@ -4407,8 +4602,6 @@ The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-validate.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html[the elasticsearch docs] for more about this method. // no examples @@ -4489,6 +4682,110 @@ Options::: link:#[back to top] +[[api-ingest-deletepipeline]] +=== `ingest.deletePipeline` + +[source,js] +-------- +client.ingest.deletePipeline([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`id`:: +`String` -- Pipeline ID + +link:#[back to top] + +[[api-ingest-getpipeline]] +=== `ingest.getPipeline` + +[source,js] +-------- +client.ingest.getPipeline([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`id`:: +`String` -- Comma separated list of pipeline ids. Wildcards supported + +link:#[back to top] + +[[api-ingest-putpipeline]] +=== `ingest.putPipeline` + +[source,js] +-------- +client.ingest.putPipeline([params, [callback]]) +-------- + +// no description + +The default method is `PUT` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`id`:: +`String` -- Pipeline ID + +link:#[back to top] + +[[api-ingest-simulate]] +=== `ingest.simulate` + +[source,js] +-------- +client.ingest.simulate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`verbose`:: +`Boolean` -- Verbose mode. Display data output for each processor in executed pipeline +`id`:: +`String` -- Pipeline ID + +link:#[back to top] + [[api-nodes-hotthreads]] === `nodes.hotThreads` @@ -4499,7 +4796,7 @@ client.nodes.hotThreads([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-nodes-hot-threads.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html[the elasticsearch docs] for more about this method. // no examples @@ -4539,7 +4836,7 @@ client.nodes.info([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-nodes-info.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html[the elasticsearch docs] for more about this method. // no examples @@ -4570,7 +4867,7 @@ client.nodes.stats([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-nodes-stats.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html[the elasticsearch docs] for more about this method. // no examples @@ -4589,10 +4886,10 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4647,7 +4944,7 @@ client.snapshot.createRepository([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4676,7 +4973,7 @@ client.snapshot.delete([params, [callback]]) // no description -The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4703,7 +5000,7 @@ client.snapshot.deleteRepository([params, [callback]]) // no description -The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4730,7 +5027,7 @@ client.snapshot.get([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4740,6 +5037,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4784,7 +5083,7 @@ client.snapshot.restore([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4813,7 +5112,7 @@ client.snapshot.status([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4823,6 +5122,8 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. // no examples @@ -4867,7 +5168,7 @@ client.tasks.cancel([params, [callback]]) // no description -The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/tasks.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html[the elasticsearch docs] for more about this method. // no examples @@ -4888,6 +5189,31 @@ The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`waitForCompletion`:: +`Boolean` -- Wait for the matching tasks to complete (default: false) +`taskId`:: +`String` -- Return the task with specified id (node_id:task_number) + +link:#[back to top] + [[api-tasks-list]] === `tasks.list` @@ -4898,7 +5224,7 @@ client.tasks.list([params, [callback]]) // no description -The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/tasks.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html[the elasticsearch docs] for more about this method. // no examples @@ -4918,7 +5244,11 @@ The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-bulk.html[the elasticsearch docs] for more about 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`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`refresh`:: +`Boolean` -- Refresh the index after performing the operation +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`type`:: +`String` -- Default document type for items which don't provide one +`fields`:: +`String, String[], Boolean` -- Default comma-separated list of fields to return in the response for updates +`index`:: +`String` -- Default index for items which don't provide one + +link:#[back to top] + +[[api-clearscroll-2-3]] +=== `clearScroll` + +[source,js] +-------- +client.clearScroll([params, [callback]]) +-------- + +Clear the scroll request created by specifying the scroll parameter to search. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-request-scroll.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`scrollId`:: +`String, String[], Boolean` -- A comma-separated list of scroll IDs to clear + +link:#[back to top] + +[[api-count-2-3]] +=== `count` + +[source,js] +-------- +client.count([params, [callback]]) +-------- + +Get the number of documents for the cluster, index, type, or a query. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-count.html[the elasticsearch docs] for more about this method. + +.Get the number of all documents in the cluster +[source,js] +--------- +client.count(function (error, response, status) { + // check for and handle error + var count = response.count; +}); +--------- + +.Get the number of documents in an index +[source,js] +--------- +client.count({ + index: 'index_name' +}, function (error, response) { + // ... +}); +--------- + +.Get the number of documents matching a query +[source,js] +--------- +client.count({ + index: 'index_name', + body: { + query: { + filtered: { + filter: { + terms: { + foo: ['bar'] + } + } + } + } + } +}, function (err, response) { + // ... +}); +--------- + + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`minScore`:: +`Number` -- Include only documents with a specific `_score` value in the result +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String` -- Specific routing value +`q`:: +`String` -- Query in the Lucene query string syntax +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`index`:: +`String, String[], Boolean` -- A comma-separated list of indices to restrict the results +`type`:: +`String, String[], Boolean` -- A comma-separated list of types to restrict the results + +link:#[back to top] + +[[api-countpercolate-2-3]] +=== `countPercolate` + +[source,js] +-------- +client.countPercolate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-percolate.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`percolateIndex`:: +`String` -- The index to count percolate the document into. Defaults to index. +`percolateType`:: +`String` -- The type to count percolate document into. Defaults to type. +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`index`:: +`String` -- The index of the document being count percolated. +`type`:: +`String` -- The type of the document being count percolated. +`id`:: +`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. + +link:#[back to top] + +[[api-create-2-3]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-index_.html[the elasticsearch docs] for more about this method. + +.Create a document +[source,js] +--------- +client.create({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + title: 'Test 1', + tags: ['y', 'z'], + published: true, + published_at: '2013-01-01', + counter: 1 + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`parent`:: +`String` -- ID of the parent document +`refresh`:: +`Boolean` -- Refresh the index after performing the operation +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`timestamp`:: +`Date, Number` -- Explicit timestamp for the document +`ttl`:: +`Duration` -- Expiration time for the document +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-delete-2-3]] +=== `delete` + +[source,js] +-------- +client.delete([params, [callback]]) +-------- + +Delete a typed JSON document from a specific index based on its id. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-delete.html[the elasticsearch docs] for more about this method. + +.Delete the document `/myindex/mytype/1` +[source,js] +--------- +client.delete({ + index: 'myindex', + type: 'mytype', + id: '1' +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`consistency`:: +`String` -- Specific write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`parent`:: +`String` -- ID of parent document +`refresh`:: +`Boolean` -- Refresh the index after performing the operation +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-deletescript-2-3]] +=== `deleteScript` + +[source,js] +-------- +client.deleteScript([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Script ID +`lang`:: +`String` -- Script language + +link:#[back to top] + +[[api-deletetemplate-2-3]] +=== `deleteTemplate` + +[source,js] +-------- +client.deleteTemplate([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Template ID + +link:#[back to top] + +[[api-exists-2-3]] +=== `exists` + +[source,js] +-------- +client.exists([params, [callback]]) +-------- + +Returns a boolean indicating whether or not a given document exists. + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-get.html[the elasticsearch docs] for more about this method. + +.Check that the document `/myindex/mytype/1` exist +[source,js] +--------- +client.exists({ + index: 'myindex', + type: 'mytype', + id: 1 +}, function (error, exists) { + if (exists === true) { + // ... + } else { + // ... + } +}); +--------- + + +*Params* + +[horizontal] +`parent`:: +`String` -- The ID of the parent document +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`realtime`:: +`Boolean` -- Specify whether to perform the operation in realtime or search mode +`refresh`:: +`Boolean` -- Refresh the shard containing the document before performing the operation +`routing`:: +`String` -- Specific routing value +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document (use `_all` to fetch the first document matching the ID across all types) + +link:#[back to top] + +[[api-explain-2-3]] +=== `explain` + +[source,js] +-------- +client.explain([params, [callback]]) +-------- + +Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. Also check out http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html[percolaters]. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-explain.html[the elasticsearch docs] for more about this method. + +.See how a document is scored against a simple query +[source,js] +--------- +client.explain({ + // the document to test + index: 'myindex', + type: 'mytype', + id: '1', + + // the query to score it against + q: 'field:value' +}, function (error, response) { + // ... +}); +--------- + +.See how a document is scored against a query written in the Query DSL +[source,js] +--------- +client.explain({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + query: { + match: { title: 'test' } + } + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) +`analyzer`:: +`String` -- The analyzer for the query string query +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The default field for query string query (default: _all) +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`parent`:: +`String` -- The ID of the parent document +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`q`:: +`String` -- Query in the Lucene query string syntax +`routing`:: +`String` -- Specific routing value +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-fieldstats-2-3]] +=== `fieldStats` + +[source,js] +-------- +client.fieldStats([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-field-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields for to get field statistics for (min value, max value, and more) +`[level=cluster]`:: +`String` -- Defines if field stats should be returned on a per index level or on a cluster wide level +Options::: + * `"indices"` + * `"cluster"` + +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], 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-get-2-3]] +=== `get` + +[source,js] +-------- +client.get([params, [callback]]) +-------- + +Get a typed JSON document from the index based on its id. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-get.html[the elasticsearch docs] for more about this method. + +.Get `/myindex/mytype/1` +[source,js] +--------- +client.get({ + index: 'myindex', + type: 'mytype', + id: 1 +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`parent`:: +`String` -- The ID of the parent document +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`realtime`:: +`Boolean` -- Specify whether to perform the operation in realtime or search mode +`refresh`:: +`Boolean` -- Refresh the shard containing the document before performing the operation +`routing`:: +`String` -- Specific routing value +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document (use `_all` to fetch the first document matching the ID across all types) + +link:#[back to top] + +[[api-getscript-2-3]] +=== `getScript` + +[source,js] +-------- +client.getScript([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Script ID +`lang`:: +`String` -- Script language + +link:#[back to top] + +[[api-getsource-2-3]] +=== `getSource` + +[source,js] +-------- +client.getSource([params, [callback]]) +-------- + +Get the source of a document by its index, type and id. + + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-get.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`parent`:: +`String` -- The ID of the parent document +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`realtime`:: +`Boolean` -- Specify whether to perform the operation in realtime or search mode +`refresh`:: +`Boolean` -- Refresh the shard containing the document before performing the operation +`routing`:: +`String` -- Specific routing value +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document; use `_all` to fetch the first document matching the ID across all types + +link:#[back to top] + +[[api-gettemplate-2-3]] +=== `getTemplate` + +[source,js] +-------- +client.getTemplate([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Template ID + +link:#[back to top] + +[[api-index-2-3]] +=== `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 <>. + + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-index_.html[the elasticsearch docs] for more about this method. + +.Create or update a document +[source,js] +--------- +client.index({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + title: 'Test 1', + tags: ['y', 'z'], + published: true, + } +}, function (error, response) { + +}); +--------- + + +*Params* + +[horizontal] +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`parent`:: +`String` -- ID of the parent document +`refresh`:: +`Boolean` -- Refresh the index after performing the operation +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`timestamp`:: +`Date, Number` -- Explicit timestamp for the document +`ttl`:: +`Duration` -- Expiration time for the document +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-info-2-3]] +=== `info` + +[source,js] +-------- +client.info([params, [callback]]) +-------- + +Get basic info from the current cluster. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/[the elasticsearch docs] for more about this method. + +// no examples + + + +[[api-mget-2-3]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-multi-get.html[the elasticsearch docs] for more about this method. + +.An array of doc locations. Useful for getting documents from different indices. +[source,js] +--------- +client.mget({ + body: { + docs: [ + { _index: 'indexA', _type: 'typeA', _id: '1' }, + { _index: 'indexB', _type: 'typeB', _id: '1' }, + { _index: 'indexC', _type: 'typeC', _id: '1' } + ] + } +}, function(error, response){ + // ... +}); +--------- + +.An array of ids. You must also specify the `index` and `type` that apply to all of the ids. +[source,js] +--------- +client.mget({ + index: 'myindex', + type: 'mytype', + body: { + ids: [1, 2, 3] + } +}, function(error, response){ + // ... +}); +--------- + + +*Params* + +[horizontal] +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`realtime`:: +`Boolean` -- Specify whether to perform the operation in realtime or search mode +`refresh`:: +`Boolean` -- Refresh the shard containing the document before performing the operation +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-mpercolate-2-3]] +=== `mpercolate` + +[source,js] +-------- +client.mpercolate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-percolate.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String` -- The index of the document being count percolated to use as default +`type`:: +`String` -- The type of the document being percolated to use as default. + +link:#[back to top] + +[[api-msearch-2-3]] +=== `msearch` + +[source,js] +-------- +client.msearch([params, [callback]]) +-------- + +Execute several search requests within the same request. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-multi-search.html[the elasticsearch docs] for more about this method. + +.Perform multiple different searches, the body is made up of meta/data pairs +[source,js] +--------- +client.msearch({ + body: [ + // match all query, on all indices and types + {}, + { query: { match_all: {} } }, + + // query_string query, on index/mytype + { index: 'myindex', type: 'mytype' }, + { query: { query_string: { query: '"Test 1"' } } } + ] +}); +--------- + + + +*Params* + +[horizontal] +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"query_and_fetch"` + * `"dfs_query_then_fetch"` + * `"dfs_query_and_fetch"` + * `"count"` + * `"scan"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to use as default +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to use as default + +link:#[back to top] + +[[api-mtermvectors-2-3]] +=== `mtermvectors` + +[source,js] +-------- +client.mtermvectors([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-multi-termvectors.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ids`:: +`String, String[], Boolean` -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body +`termStatistics`:: +`Boolean` -- Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`[fieldStatistics=true]`:: +`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`:: +`String, String[], Boolean` -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`[offsets=true]`:: +`Boolean` -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`[positions=true]`:: +`Boolean` -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`[payloads=true]`:: +`Boolean` -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". +`routing`:: +`String` -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`parent`:: +`String` -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`realtime`:: +`Boolean` -- Specifies if requests are real-time as opposed to near-real-time (default: true). +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`index`:: +`String` -- The index in which the document resides. +`type`:: +`String` -- The type of the document. + +link:#[back to top] + +[[api-percolate-2-3]] +=== `percolate` + +[source,js] +-------- +client.percolate([params, [callback]]) +-------- + +Match a document against registered percolator queries. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-percolate.html[the elasticsearch docs] for more about this method. + +.First, Register queries named “alert-1” and “alert-2” for the “myindex” index +[source,js] +--------- +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' + } + } + } +}, function (error, response) { + // ... +}); + +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' + } + } + } +}, function (error, response) { + // ... +}); +--------- + +.Then you can send documents to learn which query `_percolator` queries they match +[source,js] +--------- +client.percolate({ + index: 'myindex', + type: 'mytype', + body: { + doc: { + title: "Foo" + } + } +}, function (error, response) { + // response would equal + // { + // total: 1, + // matches: [ { _index: 'myindex', _id: 'alert-1' } ] + // } +}); + +client.percolate({ + index: 'myindex', + type: 'mytype', + body: { + doc: { + title: "Foo Bar" + } + } +}, function (error, response) { + // response would equal + // { + // total: 2, + // matches: [ + // { _index: 'myindex', _id: 'alert-1' }, + // { _index: 'myindex', _id: 'alert-2' } + // ] + // } +}); +--------- + + +*Params* + +[horizontal] +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`percolateIndex`:: +`String` -- The index to percolate the document into. Defaults to index. +`percolateType`:: +`String` -- The type to percolate document into. Defaults to type. +`percolateRouting`:: +`String` -- The routing value to use when percolating the existing document. +`percolatePreference`:: +`String` -- Which shard to prefer when executing the percolate request. +`percolateFormat`:: +`String` -- Return an array of matching query IDs instead of objects +Options::: + * `"ids"` + +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`index`:: +`String` -- The index of the document being percolated. +`type`:: +`String` -- The type of the document being percolated. +`id`:: +`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. + +link:#[back to top] + +[[api-ping-2-3]] +=== `ping` + +[source,js] +-------- +client.ping([params, [callback]]) +-------- + +// no description + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/[the elasticsearch docs] for more about this method. + +// no examples + + + +[[api-putscript-2-3]] +=== `putScript` + +[source,js] +-------- +client.putScript([params, [callback]]) +-------- + +// no description + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`[opType=index]`:: +`String` -- Explicit operation type +Options::: + * `"index"` + * `"create"` + +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Script ID +`lang`:: +`String` -- Script language + +link:#[back to top] + +[[api-puttemplate-2-3]] +=== `putTemplate` + +[source,js] +-------- +client.putTemplate([params, [callback]]) +-------- + +// no description + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`[opType=index]`:: +`String` -- Explicit operation type +Options::: + * `"index"` + * `"create"` + +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Template ID + +link:#[back to top] + +[[api-reindex-2-3]] +=== `reindex` + +[source,js] +-------- +client.reindex([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-reindex.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`refresh`:: +`Boolean` -- Should the effected indexes be refreshed? +`[timeout=1m]`:: +`Date, Number` -- Time each individual bulk request should wait for shards that are unavailable. +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`waitForCompletion`:: +`Boolean` -- Should the request should block until the reindex is complete. + +link:#[back to top] + +[[api-rendersearchtemplate-2-3]] +=== `renderSearchTemplate` + +[source,js] +-------- +client.renderSearchTemplate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/2.3/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`id`:: +`String` -- The id of the stored search template + +link:#[back to top] + +[[api-scroll-2-3]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-request-scroll.html[the elasticsearch docs] for more about 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`:: +`Duration` -- Specify how long a consistent view of the index should be maintained for scrolled search +`scrollId`:: +`String` -- The scroll ID + +link:#[back to top] + +[[api-search-2-3]] +=== `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/fullscale/elastic.js[elastic.js], https://github.com/holidayextras/esq[esq], or https://github.com/danpaz/bodybuilder[bodybuilder] can be used to make building query bodies easier. + + + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-search.html[the elasticsearch docs] for more about this method. + +.Search with a simple query string query +[source,js] +--------- +client.search({ + index: 'myindex', + q: 'title:test' +}, function (error, response) { + // ... +}); +--------- + +.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash` +[source,js] +--------- +client.search({ + index: 'myindex', + body: { + query: { + match: { + title: 'test' + } + }, + facets: { + tags: { + terms: { + field: 'tags' + } + } + } + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`explain`:: +`Boolean` -- Specify whether to return detailed information about score computation as part of a hit +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as part of a hit +`fielddataFields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as the field data representation of a field for each hit +`from`:: +`Number` -- Starting offset (default: 0) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`q`:: +`String` -- Query in the Lucene query string syntax +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`scroll`:: +`Duration` -- Specify how long a consistent view of the index should be maintained for scrolled search +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"dfs_query_then_fetch"` + * `"count"` + * `"scan"` + +`size`:: +`Number` -- Number of hits to return (default: 10) +`sort`:: +`String, String[], Boolean` -- A comma-separated list of : pairs +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`terminateAfter`:: +`Number` -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. +`stats`:: +`String, String[], Boolean` -- Specific 'tag' of the request for logging and statistical purposes +`suggestField`:: +`String` -- Specify which field to use for suggestions +`[suggestMode=missing]`:: +`String` -- Specify suggest mode +Options::: + * `"missing"` + * `"popular"` + * `"always"` + +`suggestSize`:: +`Number` -- How many suggestions to return in response +`suggestText`:: +`Text` -- The source text for which the suggestions should be returned +`timeout`:: +`Date, Number` -- Explicit operation timeout +`trackScores`:: +`Boolean` -- Whether to calculate and return scores even if they are not used for sorting +`version`:: +`Boolean` -- Specify whether to return document version as part of a hit +`requestCache`:: +`Boolean` -- Specify if request cache should be used for this request or not, defaults to index level setting +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-searchexists-2-3]] +=== `searchExists` + +[source,js] +-------- +client.searchExists([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-exists.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`minScore`:: +`Number` -- Include only documents with a specific `_score` value in the result +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String` -- Specific routing value +`q`:: +`String` -- Query in the Lucene query string syntax +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`index`:: +`String, String[], Boolean` -- A comma-separated list of indices to restrict the results +`type`:: +`String, String[], Boolean` -- A comma-separated list of types to restrict the results + +link:#[back to top] + +[[api-searchshards-2-3]] +=== `searchShards` + +[source,js] +-------- +client.searchShards([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-shards.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String` -- Specific routing value +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-searchtemplate-2-3]] +=== `searchTemplate` + +[source,js] +-------- +client.searchTemplate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`scroll`:: +`Duration` -- Specify how long a consistent view of the index should be maintained for scrolled search +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"query_and_fetch"` + * `"dfs_query_then_fetch"` + * `"dfs_query_and_fetch"` + * `"count"` + * `"scan"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-suggest-2-3]] +=== `suggest` + +[source,js] +-------- +client.suggest([params, [callback]]) +-------- + +The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-suggesters.html[the elasticsearch docs] for more about this method. + +.Return query terms suggestions (“auto-correction”) +[source,js] +--------- +client.suggest({ +index: 'myindex', +body: { + mysuggester: { + text: 'tset', + term: { + field: 'title' + } + } +} +}, function (error, response) { +// response will be formatted like so: +// +// { +// ... +// mysuggester: [ +// { +// text: "tset", +// ... +// options: [ +// { +// text: "test", +// score: 0.75, +// freq: 5 +// } +// ] +// } +// ] +// } +}); +--------- + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String` -- Specific routing value +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + +link:#[back to top] + +[[api-termvectors-2-3]] +=== `termvectors` + +[source,js] +-------- +client.termvectors([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-termvectors.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`termStatistics`:: +`Boolean` -- Specifies if total term frequency and document frequency should be returned. +`[fieldStatistics=true]`:: +`Boolean` -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. +`dfs`:: +`Boolean` -- Specifies if distributed frequencies should be returned instead shard frequencies. +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return. +`[offsets=true]`:: +`Boolean` -- Specifies if term offsets should be returned. +`[positions=true]`:: +`Boolean` -- Specifies if term positions should be returned. +`[payloads=true]`:: +`Boolean` -- Specifies if term payloads should be returned. +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random). +`routing`:: +`String` -- Specific routing value. +`parent`:: +`String` -- Parent id of documents. +`realtime`:: +`Boolean` -- Specifies if request is real-time as opposed to near-real-time (default: true). +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`index`:: +`String` -- The index in which the document resides. +`type`:: +`String` -- The type of the document. +`id`:: +`String` -- The id of the document, when not specified a doc param should be supplied. + +link:#[back to top] + +[[api-update-2-3]] +=== `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 + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-update.html[the elasticsearch docs] for more about this method. + +.Update document title using partial document +[source,js] +--------- +client.update({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + // put the partial document under the `doc` key + doc: { + title: 'Updated' + } + } +}, function (error, response) { + // ... +}) +--------- + +.Add a tag to document `tags` property using a `script` +[source,js] +--------- +client.update({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + script: 'ctx._source.tags += tag', + params: { tag: 'some new tag' } + } +}, function (error, response) { + // ... +}); +--------- + +.Increment a document counter by 1 or initialize it, when the document does not exist +[source,js] +--------- +client.update({ + index: 'myindex', + type: 'mytype', + id: '777', + body: { + script: 'ctx._source.counter += 1', + upsert: { + counter: 1 + } + } +}, function (error, response) { + // ... +}) +--------- + +.Delete a document if it's tagged “to-delete” +[source,js] +--------- +client.update({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"', + params: { + tag: 'to-delete' + } + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`lang`:: +`String` -- The script language (default: groovy) +`parent`:: +`String` -- ID of the parent document. Is is only used for routing and when for the upsert request +`refresh`:: +`Boolean` -- Refresh the index after performing the operation +`retryOnConflict`:: +`Number` -- Specify how many times should the operation be retried when a conflict occurs (default: 0) +`routing`:: +`String` -- Specific routing value +`script`:: +`Anything` -- The URL-encoded script definition (instead of using request body) +`scriptId`:: +`Anything` -- The id of a stored script +`scriptedUpsert`:: +`Boolean` -- True if the script referenced in script or script_id should be called to perform inserts - defaults to false +`timeout`:: +`Date, Number` -- Explicit operation timeout +`timestamp`:: +`Date, Number` -- Explicit timestamp for the document +`ttl`:: +`Duration` -- Expiration time for the document +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"force"` + +`id`:: +`String` -- Document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-updatebyquery-2-3]] +=== `updateByQuery` + +[source,js] +-------- +client.updateByQuery([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-update-by-query.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`explain`:: +`Boolean` -- Specify whether to return detailed information about score computation as part of a hit +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as part of a hit +`fielddataFields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as the field data representation of a field for each hit +`from`:: +`Number` -- Starting offset (default: 0) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[conflicts=abort]`:: +`String` -- What to do when the reindex hits version conflicts? +Options::: + * `"abort"` + * `"proceed"` + +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`q`:: +`String` -- Query in the Lucene query string syntax +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`scroll`:: +`Duration` -- Specify how long a consistent view of the index should be maintained for scrolled search +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"dfs_query_then_fetch"` + +`searchTimeout`:: +`Date, Number` -- Explicit timeout for each search request. Defaults to no timeout. +`size`:: +`Number` -- Number of hits to return (default: 10) +`sort`:: +`String, String[], Boolean` -- A comma-separated list of : pairs +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`terminateAfter`:: +`Number` -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. +`stats`:: +`String, String[], Boolean` -- Specific 'tag' of the request for logging and statistical purposes +`suggestField`:: +`String` -- Specify which field to use for suggestions +`[suggestMode=missing]`:: +`String` -- Specify suggest mode +Options::: + * `"missing"` + * `"popular"` + * `"always"` + +`suggestSize`:: +`Number` -- How many suggestions to return in response +`suggestText`:: +`Text` -- The source text for which the suggestions should be returned +`[timeout=1m]`:: +`Date, Number` -- Time each individual bulk request should wait for shards that are unavailable. +`trackScores`:: +`Boolean` -- Whether to calculate and return scores even if they are not used for sorting +`version`:: +`Boolean` -- Specify whether to return document version as part of a hit +`versionType`:: +`Boolean` -- Should the document increment the version number (internal) on hit or not (reindex) +`requestCache`:: +`Boolean` -- Specify if request cache should be used for this request or not, defaults to index level setting +`refresh`:: +`Boolean` -- Should the effected indexes be refreshed? +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`scrollSize`:: +`Integer` -- Size on the scroll request powering the update_by_query +`waitForCompletion`:: +`Boolean` -- Should the request should block until the reindex is complete. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-cat-aliases-2-3]] +=== `cat.aliases` + +[source,js] +-------- +client.cat.aliases([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to return + +link:#[back to top] + +[[api-cat-allocation-2-3]] +=== `cat.allocation` + +[source,js] +-------- +client.cat.allocation([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-allocation.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +Options::: + * `"b"` + * `"k"` + * `"m"` + * `"g"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information + +link:#[back to top] + +[[api-cat-count-2-3]] +=== `cat.count` + +[source,js] +-------- +client.cat.count([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-count.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-fielddata-2-3]] +=== `cat.fielddata` + +[source,js] +-------- +client.cat.fielddata([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-fielddata.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +Options::: + * `"b"` + * `"k"` + * `"m"` + * `"g"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return the fielddata size + +link:#[back to top] + +[[api-cat-health-2-3]] +=== `cat.health` + +[source,js] +-------- +client.cat.health([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-health.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`[ts=true]`:: +`Boolean` -- Set to false to disable timestamping +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-help-2-3]] +=== `cat.help` + +[source,js] +-------- +client.cat.help([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`help`:: +`Boolean` -- Return help information + +link:#[back to top] + +[[api-cat-indices-2-3]] +=== `cat.indices` + +[source,js] +-------- +client.cat.indices([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-indices.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +Options::: + * `"b"` + * `"k"` + * `"m"` + * `"g"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`pri`:: +`Boolean` -- Set to true to return stats only for primary shards +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-master-2-3]] +=== `cat.master` + +[source,js] +-------- +client.cat.master([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-master.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-nodeattrs-2-3]] +=== `cat.nodeattrs` + +[source,js] +-------- +client.cat.nodeattrs([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-nodeattrs.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-nodes-2-3]] +=== `cat.nodes` + +[source,js] +-------- +client.cat.nodes([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-nodes.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-pendingtasks-2-3]] +=== `cat.pendingTasks` + +[source,js] +-------- +client.cat.pendingTasks([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-pending-tasks.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-plugins-2-3]] +=== `cat.plugins` + +[source,js] +-------- +client.cat.plugins([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-plugins.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-recovery-2-3]] +=== `cat.recovery` + +[source,js] +-------- +client.cat.recovery([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-recovery.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +Options::: + * `"b"` + * `"k"` + * `"m"` + * `"g"` + +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-repositories-2-3]] +=== `cat.repositories` + +[source,js] +-------- +client.cat.repositories([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-repositories.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-segments-2-3]] +=== `cat.segments` + +[source,js] +-------- +client.cat.segments([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-segments.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-shards-2-3]] +=== `cat.shards` + +[source,js] +-------- +client.cat.shards([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-shards.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-snapshots-2-3]] +=== `cat.snapshots` + +[source,js] +-------- +client.cat.snapshots([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Set to true to ignore unavailable snapshots +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`repository`:: +`String, String[], Boolean` -- Name of repository from which to fetch the snapshot information + +link:#[back to top] + +[[api-cat-threadpool-2-3]] +=== `cat.threadPool` + +[source,js] +-------- +client.cat.threadPool([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-thread-pool.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`fullId`:: +`Boolean` -- Enables displaying the complete node ids + +link:#[back to top] + +[[api-cluster-getsettings-2-3]] +=== `cluster.getSettings` + +[source,js] +-------- +client.cluster.getSettings([params, [callback]]) +-------- + +Get cluster settings (previously set with `putSettings()`) + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-update-settings.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout + +link:#[back to top] + +[[api-cluster-health-2-3]] +=== `cluster.health` + +[source,js] +-------- +client.cluster.health([params, [callback]]) +-------- + +Get a very simple status on the health of the cluster. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-health.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`[level=cluster]`:: +`String` -- Specify the level of detail for returned information +Options::: + * `"cluster"` + * `"indices"` + * `"shards"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`waitForActiveShards`:: +`Number` -- Wait until the specified number of shards is active +`waitForNodes`:: +`String` -- Wait until the specified number of nodes is available +`waitForRelocatingShards`:: +`Number` -- Wait until the specified number of relocating shards is finished +`waitForStatus`:: +`String` -- Wait until cluster is in a specific state +Options::: + * `"green"` + * `"yellow"` + * `"red"` + +`index`:: +`String, String[], Boolean` -- Limit the information returned to a specific index + +link:#[back to top] + +[[api-cluster-pendingtasks-2-3]] +=== `cluster.pendingTasks` + +[source,js] +-------- +client.cluster.pendingTasks([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-pending.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master + +link:#[back to top] + +[[api-cluster-putsettings-2-3]] +=== `cluster.putSettings` + +[source,js] +-------- +client.cluster.putSettings([params, [callback]]) +-------- + +Update cluster wide specific settings. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-update-settings.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout + +link:#[back to top] + +[[api-cluster-reroute-2-3]] +=== `cluster.reroute` + +[source,js] +-------- +client.cluster.reroute([params, [callback]]) +-------- + +Explicitly execute a cluster reroute allocation command including specific commands. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-reroute.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`dryRun`:: +`Boolean` -- Simulate the operation only and return the resulting state +`explain`:: +`Boolean` -- Return an explanation of why the commands can or cannot be executed +`metric`:: +`String, String[], Boolean` -- Limit the information returned to the specified metrics. Defaults to all but metadata +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout + +link:#[back to top] + +[[api-cluster-state-2-3]] +=== `cluster.state` + +[source,js] +-------- +client.cluster.state([params, [callback]]) +-------- + +Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-state.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices +`metric`:: +`String, String[], Boolean` -- Limit the information returned to the specified metrics + +link:#[back to top] + +[[api-cluster-stats-2-3]] +=== `cluster.stats` + +[source,js] +-------- +client.cluster.stats([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`timeout`:: +`Date, Number` -- Explicit operation timeout +`nodeId`:: +`String, String[], 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-2-3]] +=== `indices.analyze` + +[source,js] +-------- +client.indices.analyze([params, [callback]]) +-------- + +Perform the analysis process on a text and return the tokens breakdown of the text. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-analyze.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`analyzer`:: +`String` -- The name of the analyzer to use +`charFilters`:: +`String, String[], Boolean` -- Deprecated : A comma-separated list of character filters to use for the analysis +`charFilter`:: +`String, String[], Boolean` -- A comma-separated list of character filters to use for the analysis +`field`:: +`String` -- Use the analyzer configured for this field (instead of passing the analyzer name) +`filters`:: +`String, String[], Boolean` -- Deprecated : A comma-separated list of filters to use for the analysis +`filter`:: +`String, String[], Boolean` -- A comma-separated list of filters to use for the analysis +`index`:: +`String` -- The name of the index to scope the operation +`preferLocal`:: +`Boolean` -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) +`text`:: +`String, String[], Boolean` -- The text on which the analysis should be performed (when request body is not used) +`tokenizer`:: +`String` -- The name of the tokenizer to use for the analysis +`explain`:: +`Boolean` -- With `true`, outputs more advanced details. (default: false) +`attributes`:: +`String, String[], Boolean` -- A comma-separated list of token attributes to output, this parameter works only with `explain=true` +`[format=detailed]`:: +`String` -- Format of the output +Options::: + * `"detailed"` + * `"text"` + + +link:#[back to top] + +[[api-indices-clearcache-2-3]] +=== `indices.clearCache` + +[source,js] +-------- +client.indices.clearCache([params, [callback]]) +-------- + +Clear either all caches or specific cached associated with one ore more indices. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-clearcache.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`fieldData`:: +`Boolean` -- Clear field data +`fielddata`:: +`Boolean` -- Clear field data +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all) +`query`:: +`Boolean` -- Clear query caches +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index name to limit the operation +`recycler`:: +`Boolean` -- Clear the recycler cache +`request`:: +`Boolean` -- Clear request cache + +link:#[back to top] + +[[api-indices-close-2-3]] +=== `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. + + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-open-close.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma separated list of indices to close + +link:#[back to top] + +[[api-indices-create-2-3]] +=== `indices.create` + +[source,js] +-------- +client.indices.create([params, [callback]]) +-------- + +Create an index in Elasticsearch. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-create-index.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`updateAllTypes`:: +`Boolean` -- Whether to update the mapping for all fields with the same name across all types or not +`index`:: +`String` -- The name of the index + +link:#[back to top] + +[[api-indices-delete-2-3]] +=== `indices.delete` + +[source,js] +-------- +client.indices.delete([params, [callback]]) +-------- + +Delete an index in Elasticsearch + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-delete-index.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`index`:: +`String, String[], Boolean` -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices + +link:#[back to top] + +[[api-indices-deletealias-2-3]] +=== `indices.deleteAlias` + +[source,js] +-------- +client.indices.deleteAlias([params, [callback]]) +-------- + +Delete a specific alias. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit timestamp for the document +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names (supports wildcards); use `_all` for all indices +`name`:: +`String, String[], Boolean` -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. + +link:#[back to top] + +[[api-indices-deletetemplate-2-3]] +=== `indices.deleteTemplate` + +[source,js] +-------- +client.indices.deleteTemplate([params, [callback]]) +-------- + +Delete an index template by its name. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`name`:: +`String` -- The name of the template + +link:#[back to top] + +[[api-indices-deletewarmer-2-3]] +=== `indices.deleteWarmer` + +[source,js] +-------- +client.indices.deleteWarmer([params, [callback]]) +-------- + +Delete an index warmer. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-warmers.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`name`:: +`String, String[], 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`:: +`String, String[], Boolean` -- A comma-separated list of index names to delete warmers from (supports wildcards); use `_all` to perform the operation on all indices. + +link:#[back to top] + +[[api-indices-exists-2-3]] +=== `indices.exists` + +[source,js] +-------- +client.indices.exists([params, [callback]]) +-------- + +Return a boolean indicating whether given index exists. + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-exists.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of indices to check + +link:#[back to top] + +[[api-indices-existsalias-2-3]] +=== `indices.existsAlias` + +[source,js] +-------- +client.indices.existsAlias([params, [callback]]) +-------- + +Return a boolean indicating whether given alias exists. + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open,closed]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to filter aliases +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to return + +link:#[back to top] + +[[api-indices-existstemplate-2-3]] +=== `indices.existsTemplate` + +[source,js] +-------- +client.indices.existsTemplate([params, [callback]]) +-------- + +// no description + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`name`:: +`String` -- The name of the template + +link:#[back to top] + +[[api-indices-existstype-2-3]] +=== `indices.existsType` + +[source,js] +-------- +client.indices.existsType([params, [callback]]) +-------- + +Check if a type/types exists in an index/indices. + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-types-exists.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` to check the types across all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to check + +link:#[back to top] + +[[api-indices-flush-2-3]] +=== `indices.flush` + +[source,js] +-------- +client.indices.flush([params, [callback]]) +-------- + +Explicitly flush one or more indices. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-flush.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`force`:: +`Boolean` -- Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) +`waitIfOngoing`:: +`Boolean` -- If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is false and will cause an exception to be thrown on the shard level if another flush operation is already running. +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string for all indices + +link:#[back to top] + +[[api-indices-flushsynced-2-3]] +=== `indices.flushSynced` + +[source,js] +-------- +client.indices.flushSynced([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-synced-flush.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string for all indices + +link:#[back to top] + +[[api-indices-forcemerge-2-3]] +=== `indices.forcemerge` + +[source,js] +-------- +client.indices.forcemerge([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-forcemerge.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flush`:: +`Boolean` -- Specify whether the index should be flushed after performing the operation (default: true) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`maxNumSegments`:: +`Number` -- The number of segments the index should be merged into (default: dynamic) +`onlyExpungeDeletes`:: +`Boolean` -- Specify whether the operation should only expunge deleted documents +`operationThreading`:: +`Anything` -- TODO: ? +`waitForMerge`:: +`Boolean` -- Specify whether the request should block until the merge process is finished (default: true) +`index`:: +`String, String[], 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-get-2-3]] +=== `indices.get` + +[source,js] +-------- +client.indices.get([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-get-index.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`ignoreUnavailable`:: +`Boolean` -- Ignore unavailable indexes (default: false) +`allowNoIndices`:: +`Boolean` -- Ignore if a wildcard expression resolves to no concrete indices (default: false) +`[expandWildcards=open]`:: +`String` -- Whether wildcard expressions should get expanded to open or closed indices (default: open) +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`human`:: +`Boolean` -- Whether to return version and creation date values in human-readable format. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names +`feature`:: +`String, String[], Boolean` -- A comma-separated list of features + +link:#[back to top] + +[[api-indices-getalias-2-3]] +=== `indices.getAlias` + +[source,js] +-------- +client.indices.getAlias([params, [callback]]) +-------- + +Retrieve a specified alias. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to filter aliases +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to return + +link:#[back to top] + +[[api-indices-getaliases-2-3]] +=== `indices.getAliases` + +[source,js] +-------- +client.indices.getAliases([params, [callback]]) +-------- + +Retrieve specified aliases + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to filter aliases +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to filter + +link:#[back to top] + +[[api-indices-getfieldmapping-2-3]] +=== `indices.getFieldMapping` + +[source,js] +-------- +client.indices.getFieldMapping([params, [callback]]) +-------- + +Retrieve mapping definition of a specific field. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-get-field-mapping.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`includeDefaults`:: +`Boolean` -- Whether the default mapping values should be returned as well +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields + +link:#[back to top] + +[[api-indices-getmapping-2-3]] +=== `indices.getMapping` + +[source,js] +-------- +client.indices.getMapping([params, [callback]]) +-------- + +Retrieve mapping definition of index or index/type. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-get-mapping.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types + +link:#[back to top] + +[[api-indices-getsettings-2-3]] +=== `indices.getSettings` + +[source,js] +-------- +client.indices.getSettings([params, [callback]]) +-------- + +Retrieve settings for one or more (or all) indices. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-get-settings.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open,closed]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`human`:: +`Boolean` -- Whether to return version and creation date values in human-readable format. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices +`name`:: +`String, String[], Boolean` -- The name of the settings that should be included + +link:#[back to top] + +[[api-indices-gettemplate-2-3]] +=== `indices.getTemplate` + +[source,js] +-------- +client.indices.getTemplate([params, [callback]]) +-------- + +Retrieve an index template by its name. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`name`:: +`String, String[], Boolean` -- The comma separated names of the index templates + +link:#[back to top] + +[[api-indices-getupgrade-2-3]] +=== `indices.getUpgrade` + +[source,js] +-------- +client.indices.getUpgrade([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-upgrade.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`index`:: +`String, String[], 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-2-3]] +=== `indices.getWarmer` + +[source,js] +-------- +client.indices.getWarmer([params, [callback]]) +-------- + +Retreieve an index warmer. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-warmers.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to restrict the operation; use `_all` to perform the operation on all indices +`name`:: +`String, String[], Boolean` -- The name of the warmer (supports wildcards); leave empty to get all warmers +`type`:: +`String, String[], 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-2-3]] +=== `indices.open` + +[source,js] +-------- +client.indices.open([params, [callback]]) +-------- + +Open a closed index, making it available for search. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-open-close.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=closed]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma separated list of indices to open + +link:#[back to top] + +[[api-indices-optimize-2-3]] +=== `indices.optimize` + +[source,js] +-------- +client.indices.optimize([params, [callback]]) +-------- + +Explicitly optimize one or more indices. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-optimize.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flush`:: +`Boolean` -- Specify whether the index should be flushed after performing the operation (default: true) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`maxNumSegments`:: +`Number` -- The number of segments the index should be merged into (default: dynamic) +`onlyExpungeDeletes`:: +`Boolean` -- Specify whether the operation should only expunge deleted documents +`operationThreading`:: +`Anything` -- TODO: ? +`waitForMerge`:: +`Boolean` -- Specify whether the request should block until the merge process is finished (default: true) +`index`:: +`String, String[], 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-putalias-2-3]] +=== `indices.putAlias` + +[source,js] +-------- +client.indices.putAlias([params, [callback]]) +-------- + +Create an alias for a specific index/indices. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit timestamp for the document +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`index`:: +`String, String[], 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`:: +`String` -- The name of the alias to be created or updated + +link:#[back to top] + +[[api-indices-putmapping-2-3]] +=== `indices.putMapping` + +[source,js] +-------- +client.indices.putMapping([params, [callback]]) +-------- + +Register specific mapping definition for a specific type. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-put-mapping.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`updateAllTypes`:: +`Boolean` -- Whether to update the mapping for all fields with the same name across all types or not +`index`:: +`String, String[], 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`:: +`String` -- The name of the document type + +link:#[back to top] + +[[api-indices-putsettings-2-3]] +=== `indices.putSettings` + +[source,js] +-------- +client.indices.putSettings([params, [callback]]) +-------- + +Change specific index level settings in real time. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-update-settings.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`index`:: +`String, String[], 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-puttemplate-2-3]] +=== `indices.putTemplate` + +[source,js] +-------- +client.indices.putTemplate([params, [callback]]) +-------- + +Create an index template that will automatically be applied to new indices created. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`order`:: +`Number` -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) +`create`:: +`Boolean` -- Whether the index template should only be added if new or can also replace an existing one +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`name`:: +`String` -- The name of the template + +link:#[back to top] + +[[api-indices-putwarmer-2-3]] +=== `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. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-warmers.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) in the search request to warm +`allowNoIndices`:: +`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]`:: +`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"` + +`requestCache`:: +`Boolean` -- Specify whether the request to be warmed should use the request cache, defaults to index level setting +`index`:: +`String, String[], 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`:: +`String` -- The name of the warmer +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to register the warmer for; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-indices-recovery-2-3]] +=== `indices.recovery` + +[source,js] +-------- +client.indices.recovery([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-recovery.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`detailed`:: +`Boolean` -- Whether to display detailed information about shard recovery +`activeOnly`:: +`Boolean` -- Display only those recoveries that are currently on-going +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`index`:: +`String, String[], 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-2-3]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-refresh.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`force`:: +`Boolean` -- Force a refresh even if not required +`operationThreading`:: +`Anything` -- TODO: ? +`index`:: +`String, String[], 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-segments-2-3]] +=== `indices.segments` + +[source,js] +-------- +client.indices.segments([params, [callback]]) +-------- + +Retrieve low level segments information that a Lucene index (shard level) is built with. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-segments.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`operationThreading`:: +`Anything` -- TODO: ? +`verbose`:: +`Boolean` -- Includes detailed memory usage by Lucene. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + +link:#[back to top] + +[[api-indices-shardstores-2-3]] +=== `indices.shardStores` + +[source,js] +-------- +client.indices.shardStores([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-shards-stores.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`status`:: +`String, String[], Boolean` -- A comma-separated list of statuses used to filter on shards to get store information for +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`operationThreading`:: +`Anything` -- TODO: ? +`index`:: +`String, String[], 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-2-3]] +=== `indices.stats` + +[source,js] +-------- +client.indices.stats([params, [callback]]) +-------- + +Retrieve statistics on different operations happening on an index. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`completionFields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) +`fielddataFields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) +`groups`:: +`String, String[], Boolean` -- A comma-separated list of search groups for `search` index metric +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`[level=indices]`:: +`String` -- Return stats aggregated at cluster, index or shard level +Options::: + * `"cluster"` + * `"indices"` + * `"shards"` + +`types`:: +`String, String[], Boolean` -- A comma-separated list of document types for the `indexing` index metric +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices +`metric`:: +`String, String[], Boolean` -- Limit the information returned the specific metrics. + +link:#[back to top] + +[[api-indices-updatealiases-2-3]] +=== `indices.updateAliases` + +[source,js] +-------- +client.indices.updateAliases([params, [callback]]) +-------- + +Update specified aliases. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-aliases.html[the elasticsearch docs] for more about this method. + +.Perform an atomic alias swap, for a rotating index +[source,js] +--------- +client.indices.updateAliases({ + body: { + actions: [ + { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } }, + { add: { index: 'logstash-2014.05', alias: 'logstash-current' } } + ] + } +}).then(function (response) { + // ... +}, errorHandler); +--------- + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Request timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master + +link:#[back to top] + +[[api-indices-upgrade-2-3]] +=== `indices.upgrade` + +[source,js] +-------- +client.indices.upgrade([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-upgrade.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`waitForCompletion`:: +`Boolean` -- Specify whether the request should block until the all segments are upgraded (default: false) +`onlyAncientSegments`:: +`Boolean` -- If true, only ancient (an older Lucene major release) segments will be upgraded +`index`:: +`String, String[], 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-validatequery-2-3]] +=== `indices.validateQuery` + +[source,js] +-------- +client.indices.validateQuery([params, [callback]]) +-------- + +Validate a potentially expensive query without executing it. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-validate.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`explain`:: +`Boolean` -- Return detailed information about the error +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`operationThreading`:: +`Anything` -- TODO: ? +`q`:: +`String` -- Query in the Lucene query string syntax +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`rewrite`:: +`Boolean` -- Provide a more detailed explanation showing the actual Lucene query that will be executed. +`index`:: +`String, String[], 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`:: +`String, String[], 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-nodes-hotthreads-2-3]] +=== `nodes.hotThreads` + +[source,js] +-------- +client.nodes.hotThreads([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-nodes-hot-threads.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`interval`:: +`Date, Number` -- The interval for the second sampling of threads +`snapshots`:: +`Number` -- Number of samples of thread stacktrace (default: 10) +`threads`:: +`Number` -- Specify the number of threads to provide information for (default: 3) +`ignoreIdleThreads`:: +`Boolean` -- Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) +`type`:: +`String` -- The type to sample (default: cpu) +Options::: + * `"cpu"` + * `"wait"` + * `"block"` + +`timeout`:: +`Date, Number` -- Explicit operation timeout +`nodeId`:: +`String, String[], 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-2-3]] +=== `nodes.info` + +[source,js] +-------- +client.nodes.info([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-nodes-info.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`timeout`:: +`Date, Number` -- Explicit operation timeout +`nodeId`:: +`String, String[], 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`:: +`String, String[], Boolean` -- A comma-separated list of metrics you wish returned. Leave empty to return all. + +link:#[back to top] + +[[api-nodes-stats-2-3]] +=== `nodes.stats` + +[source,js] +-------- +client.nodes.stats([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cluster-nodes-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`completionFields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) +`fielddataFields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) +`groups`:: +`Boolean` -- A comma-separated list of search groups for `search` index metric +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`[level=node]`:: +`String` -- Return indices stats aggregated at node, index or shard level +Options::: + * `"node"` + * `"indices"` + * `"shards"` + +`types`:: +`String, String[], Boolean` -- A comma-separated list of document types for the `indexing` index metric +`timeout`:: +`Date, Number` -- Explicit operation timeout +`metric`:: +`String, String[], Boolean` -- Limit the information returned to the specified metrics +`indexMetric`:: +`String, String[], 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`:: +`String, String[], 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-2-3]] +=== `snapshot.create` + +[source,js] +-------- +client.snapshot.create([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`waitForCompletion`:: +`Boolean` -- Should this request wait until the operation has completed before returning +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name + +link:#[back to top] + +[[api-snapshot-createrepository-2-3]] +=== `snapshot.createRepository` + +[source,js] +-------- +client.snapshot.createRepository([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`verify`:: +`Boolean` -- Whether to verify the repository after creation +`repository`:: +`String` -- A repository name + +link:#[back to top] + +[[api-snapshot-delete-2-3]] +=== `snapshot.delete` + +[source,js] +-------- +client.snapshot.delete([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name + +link:#[back to top] + +[[api-snapshot-deleterepository-2-3]] +=== `snapshot.deleteRepository` + +[source,js] +-------- +client.snapshot.deleteRepository([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`repository`:: +`String, String[], Boolean` -- A comma-separated list of repository names + +link:#[back to top] + +[[api-snapshot-get-2-3]] +=== `snapshot.get` + +[source,js] +-------- +client.snapshot.get([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String` -- A repository name +`snapshot`:: +`String, String[], Boolean` -- A comma-separated list of snapshot names + +link:#[back to top] + +[[api-snapshot-getrepository-2-3]] +=== `snapshot.getRepository` + +[source,js] +-------- +client.snapshot.getRepository([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`repository`:: +`String, String[], Boolean` -- A comma-separated list of repository names + +link:#[back to top] + +[[api-snapshot-restore-2-3]] +=== `snapshot.restore` + +[source,js] +-------- +client.snapshot.restore([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`waitForCompletion`:: +`Boolean` -- Should this request wait until the operation has completed before returning +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name + +link:#[back to top] + +[[api-snapshot-status-2-3]] +=== `snapshot.status` + +[source,js] +-------- +client.snapshot.status([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String` -- A repository name +`snapshot`:: +`String, String[], Boolean` -- A comma-separated list of snapshot names + +link:#[back to top] + +[[api-snapshot-verifyrepository-2-3]] +=== `snapshot.verifyRepository` + +[source,js] +-------- +client.snapshot.verifyRepository([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`repository`:: +`String` -- A repository name + +link:#[back to top] + +[[api-tasks-cancel-2-3]] +=== `tasks.cancel` + +[source,js] +-------- +client.tasks.cancel([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/tasks.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes +`actions`:: +`String, String[], Boolean` -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all. +`parentNode`:: +`String` -- Cancel tasks with specified parent node. +`parentTask`:: +`String` -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. +`taskId`:: +`String` -- Cancel the task with specified task id (node_id:task_number) + +link:#[back to top] + +[[api-tasks-list-2-3]] +=== `tasks.list` + +[source,js] +-------- +client.tasks.list([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/2.3/tasks.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes +`actions`:: +`String, String[], Boolean` -- A comma-separated list of actions that should be returned. Leave empty to return all. +`detailed`:: +`Boolean` -- Return detailed task information (default: false) +`parentNode`:: +`String` -- Return tasks with specified parent node. +`parentTask`:: +`String` -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. +`waitForCompletion`:: +`Boolean` -- Wait for the matching tasks to complete (default: false) +`taskId`:: +`String` -- Return the task with specified id (node_id:task_number) + +link:#[back to top] diff --git a/docs/api_methods_2_4.asciidoc b/docs/api_methods_2_4.asciidoc new file mode 100644 index 000000000..c2d95894c --- /dev/null +++ b/docs/api_methods_2_4.asciidoc @@ -0,0 +1,4953 @@ +[[api-reference-2-4]] +== 2.4 API + + +NOTE: At this time, you must opt into the 2.4 API by setting the `apiVersion` config parameter. + + +[[api-bulk-2-4]] +=== `bulk` + +[source,js] +-------- +client.bulk([params, [callback]]) +-------- + +Perform many index/delete operations in a single API call. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html[the elasticsearch docs] for more about 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`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`refresh`:: +`Boolean` -- Refresh the index after performing the operation +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`type`:: +`String` -- Default document type for items which don't provide one +`fields`:: +`String, String[], Boolean` -- Default comma-separated list of fields to return in the response for updates +`index`:: +`String` -- Default index for items which don't provide one + +link:#[back to top] + +[[api-clearscroll-2-4]] +=== `clearScroll` + +[source,js] +-------- +client.clearScroll([params, [callback]]) +-------- + +Clear the scroll request created by specifying the scroll parameter to search. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`scrollId`:: +`String, String[], Boolean` -- A comma-separated list of scroll IDs to clear + +link:#[back to top] + +[[api-count-2-4]] +=== `count` + +[source,js] +-------- +client.count([params, [callback]]) +-------- + +Get the number of documents for the cluster, index, type, or a query. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html[the elasticsearch docs] for more about this method. + +.Get the number of all documents in the cluster +[source,js] +--------- +client.count(function (error, response, status) { + // check for and handle error + var count = response.count; +}); +--------- + +.Get the number of documents in an index +[source,js] +--------- +client.count({ + index: 'index_name' +}, function (error, response) { + // ... +}); +--------- + +.Get the number of documents matching a query +[source,js] +--------- +client.count({ + index: 'index_name', + body: { + query: { + filtered: { + filter: { + terms: { + foo: ['bar'] + } + } + } + } + } +}, function (err, response) { + // ... +}); +--------- + + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`minScore`:: +`Number` -- Include only documents with a specific `_score` value in the result +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String` -- Specific routing value +`q`:: +`String` -- Query in the Lucene query string syntax +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`index`:: +`String, String[], Boolean` -- A comma-separated list of indices to restrict the results +`type`:: +`String, String[], Boolean` -- A comma-separated list of types to restrict the results + +link:#[back to top] + +[[api-countpercolate-2-4]] +=== `countPercolate` + +[source,js] +-------- +client.countPercolate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`percolateIndex`:: +`String` -- The index to count percolate the document into. Defaults to index. +`percolateType`:: +`String` -- The type to count percolate document into. Defaults to type. +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`index`:: +`String` -- The index of the document being count percolated. +`type`:: +`String` -- The type of the document being count percolated. +`id`:: +`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. + +link:#[back to top] + +[[api-create-2-4]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html[the elasticsearch docs] for more about this method. + +.Create a document +[source,js] +--------- +client.create({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + title: 'Test 1', + tags: ['y', 'z'], + published: true, + published_at: '2013-01-01', + counter: 1 + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`parent`:: +`String` -- ID of the parent document +`refresh`:: +`Boolean` -- Refresh the affected shards after performing the operation +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`timestamp`:: +`Date, Number` -- Explicit timestamp for the document +`ttl`:: +`Date, Number` -- Expiration time for the document +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-delete-2-4]] +=== `delete` + +[source,js] +-------- +client.delete([params, [callback]]) +-------- + +Delete a typed JSON document from a specific index based on its id. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html[the elasticsearch docs] for more about this method. + +.Delete the document `/myindex/mytype/1` +[source,js] +--------- +client.delete({ + index: 'myindex', + type: 'mytype', + id: '1' +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`consistency`:: +`String` -- Specific write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`parent`:: +`String` -- ID of parent document +`refresh`:: +`Boolean` -- Refresh the index after performing the operation +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-deletescript-2-4]] +=== `deleteScript` + +[source,js] +-------- +client.deleteScript([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Script ID +`lang`:: +`String` -- Script language + +link:#[back to top] + +[[api-deletetemplate-2-4]] +=== `deleteTemplate` + +[source,js] +-------- +client.deleteTemplate([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Template ID + +link:#[back to top] + +[[api-exists-2-4]] +=== `exists` + +[source,js] +-------- +client.exists([params, [callback]]) +-------- + +Returns a boolean indicating whether or not a given document exists. + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html[the elasticsearch docs] for more about this method. + +.Check that the document `/myindex/mytype/1` exist +[source,js] +--------- +client.exists({ + index: 'myindex', + type: 'mytype', + id: 1 +}, function (error, exists) { + if (exists === true) { + // ... + } else { + // ... + } +}); +--------- + + +*Params* + +[horizontal] +`parent`:: +`String` -- The ID of the parent document +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`realtime`:: +`Boolean` -- Specify whether to perform the operation in realtime or search mode +`refresh`:: +`Boolean` -- Refresh the shard containing the document before performing the operation +`routing`:: +`String` -- Specific routing value +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document (use `_all` to fetch the first document matching the ID across all types) + +link:#[back to top] + +[[api-explain-2-4]] +=== `explain` + +[source,js] +-------- +client.explain([params, [callback]]) +-------- + +Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. Also check out http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html[percolaters]. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html[the elasticsearch docs] for more about this method. + +.See how a document is scored against a simple query +[source,js] +--------- +client.explain({ + // the document to test + index: 'myindex', + type: 'mytype', + id: '1', + + // the query to score it against + q: 'field:value' +}, function (error, response) { + // ... +}); +--------- + +.See how a document is scored against a query written in the Query DSL +[source,js] +--------- +client.explain({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + query: { + match: { title: 'test' } + } + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) +`analyzer`:: +`String` -- The analyzer for the query string query +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The default field for query string query (default: _all) +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`parent`:: +`String` -- The ID of the parent document +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`q`:: +`String` -- Query in the Lucene query string syntax +`routing`:: +`String` -- Specific routing value +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-fieldstats-2-4]] +=== `fieldStats` + +[source,js] +-------- +client.fieldStats([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields for to get field statistics for (min value, max value, and more) +`[level=cluster]`:: +`String` -- Defines if field stats should be returned on a per index level or on a cluster wide level +Options::: + * `"indices"` + * `"cluster"` + +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], 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-get-2-4]] +=== `get` + +[source,js] +-------- +client.get([params, [callback]]) +-------- + +Get a typed JSON document from the index based on its id. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html[the elasticsearch docs] for more about this method. + +.Get `/myindex/mytype/1` +[source,js] +--------- +client.get({ + index: 'myindex', + type: 'mytype', + id: 1 +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`parent`:: +`String` -- The ID of the parent document +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`realtime`:: +`Boolean` -- Specify whether to perform the operation in realtime or search mode +`refresh`:: +`Boolean` -- Refresh the shard containing the document before performing the operation +`routing`:: +`String` -- Specific routing value +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document (use `_all` to fetch the first document matching the ID across all types) + +link:#[back to top] + +[[api-getscript-2-4]] +=== `getScript` + +[source,js] +-------- +client.getScript([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Script ID +`lang`:: +`String` -- Script language + +link:#[back to top] + +[[api-getsource-2-4]] +=== `getSource` + +[source,js] +-------- +client.getSource([params, [callback]]) +-------- + +Get the source of a document by its index, type and id. + + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`parent`:: +`String` -- The ID of the parent document +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`realtime`:: +`Boolean` -- Specify whether to perform the operation in realtime or search mode +`refresh`:: +`Boolean` -- Refresh the shard containing the document before performing the operation +`routing`:: +`String` -- Specific routing value +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- The document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document; use `_all` to fetch the first document matching the ID across all types + +link:#[back to top] + +[[api-gettemplate-2-4]] +=== `getTemplate` + +[source,js] +-------- +client.getTemplate([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Template ID + +link:#[back to top] + +[[api-index-2-4]] +=== `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 <>. + + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html[the elasticsearch docs] for more about this method. + +.Create or update a document +[source,js] +--------- +client.index({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + title: 'Test 1', + tags: ['y', 'z'], + published: true, + } +}, function (error, response) { + +}); +--------- + + +*Params* + +[horizontal] +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`parent`:: +`String` -- ID of the parent document +`refresh`:: +`Boolean` -- Refresh the affected shards after performing the operation +`routing`:: +`String` -- Specific routing value +`timeout`:: +`Date, Number` -- Explicit operation timeout +`timestamp`:: +`Date, Number` -- Explicit timestamp for the document +`ttl`:: +`Date, Number` -- Expiration time for the document +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-info-2-4]] +=== `info` + +[source,js] +-------- +client.info([params, [callback]]) +-------- + +Get basic info from the current cluster. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/[the elasticsearch docs] for more about this method. + +// no examples + + + +[[api-mget-2-4]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html[the elasticsearch docs] for more about this method. + +.An array of doc locations. Useful for getting documents from different indices. +[source,js] +--------- +client.mget({ + body: { + docs: [ + { _index: 'indexA', _type: 'typeA', _id: '1' }, + { _index: 'indexB', _type: 'typeB', _id: '1' }, + { _index: 'indexC', _type: 'typeC', _id: '1' } + ] + } +}, function(error, response){ + // ... +}); +--------- + +.An array of ids. You must also specify the `index` and `type` that apply to all of the ids. +[source,js] +--------- +client.mget({ + index: 'myindex', + type: 'mytype', + body: { + ids: [1, 2, 3] + } +}, function(error, response){ + // ... +}); +--------- + + +*Params* + +[horizontal] +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`realtime`:: +`Boolean` -- Specify whether to perform the operation in realtime or search mode +`refresh`:: +`Boolean` -- Refresh the shard containing the document before performing the operation +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-mpercolate-2-4]] +=== `mpercolate` + +[source,js] +-------- +client.mpercolate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String` -- The index of the document being count percolated to use as default +`type`:: +`String` -- The type of the document being percolated to use as default. + +link:#[back to top] + +[[api-msearch-2-4]] +=== `msearch` + +[source,js] +-------- +client.msearch([params, [callback]]) +-------- + +Execute several search requests within the same request. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html[the elasticsearch docs] for more about this method. + +.Perform multiple different searches, the body is made up of meta/data pairs +[source,js] +--------- +client.msearch({ + body: [ + // match all query, on all indices and types + {}, + { query: { match_all: {} } }, + + // query_string query, on index/mytype + { index: 'myindex', type: 'mytype' }, + { query: { query_string: { query: '"Test 1"' } } } + ] +}); +--------- + + + +*Params* + +[horizontal] +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"query_and_fetch"` + * `"dfs_query_then_fetch"` + * `"dfs_query_and_fetch"` + * `"count"` + * `"scan"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to use as default +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to use as default + +link:#[back to top] + +[[api-mtermvectors-2-4]] +=== `mtermvectors` + +[source,js] +-------- +client.mtermvectors([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ids`:: +`String, String[], Boolean` -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body +`termStatistics`:: +`Boolean` -- Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`[fieldStatistics=true]`:: +`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`:: +`String, String[], Boolean` -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`[offsets=true]`:: +`Boolean` -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`[positions=true]`:: +`Boolean` -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`[payloads=true]`:: +`Boolean` -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". +`routing`:: +`String` -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`parent`:: +`String` -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". +`realtime`:: +`Boolean` -- Specifies if requests are real-time as opposed to near-real-time (default: true). +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`index`:: +`String` -- The index in which the document resides. +`type`:: +`String` -- The type of the document. + +link:#[back to top] + +[[api-percolate-2-4]] +=== `percolate` + +[source,js] +-------- +client.percolate([params, [callback]]) +-------- + +Match a document against registered percolator queries. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html[the elasticsearch docs] for more about this method. + +.First, Register queries named “alert-1” and “alert-2” for the “myindex” index +[source,js] +--------- +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' + } + } + } +}, function (error, response) { + // ... +}); + +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' + } + } + } +}, function (error, response) { + // ... +}); +--------- + +.Then you can send documents to learn which query `_percolator` queries they match +[source,js] +--------- +client.percolate({ + index: 'myindex', + type: 'mytype', + body: { + doc: { + title: "Foo" + } + } +}, function (error, response) { + // response would equal + // { + // total: 1, + // matches: [ { _index: 'myindex', _id: 'alert-1' } ] + // } +}); + +client.percolate({ + index: 'myindex', + type: 'mytype', + body: { + doc: { + title: "Foo Bar" + } + } +}, function (error, response) { + // response would equal + // { + // total: 2, + // matches: [ + // { _index: 'myindex', _id: 'alert-1' }, + // { _index: 'myindex', _id: 'alert-2' } + // ] + // } +}); +--------- + + +*Params* + +[horizontal] +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`percolateIndex`:: +`String` -- The index to percolate the document into. Defaults to index. +`percolateType`:: +`String` -- The type to percolate document into. Defaults to type. +`percolateRouting`:: +`String` -- The routing value to use when percolating the existing document. +`percolatePreference`:: +`String` -- Which shard to prefer when executing the percolate request. +`percolateFormat`:: +`String` -- Return an array of matching query IDs instead of objects +Options::: + * `"ids"` + +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`index`:: +`String` -- The index of the document being percolated. +`type`:: +`String` -- The type of the document being percolated. +`id`:: +`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. + +link:#[back to top] + +[[api-ping-2-4]] +=== `ping` + +[source,js] +-------- +client.ping([params, [callback]]) +-------- + +// no description + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/[the elasticsearch docs] for more about this method. + +// no examples + + + +[[api-putscript-2-4]] +=== `putScript` + +[source,js] +-------- +client.putScript([params, [callback]]) +-------- + +// no description + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`[opType=index]`:: +`String` -- Explicit operation type +Options::: + * `"index"` + * `"create"` + +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Script ID +`lang`:: +`String` -- Script language + +link:#[back to top] + +[[api-puttemplate-2-4]] +=== `putTemplate` + +[source,js] +-------- +client.putTemplate([params, [callback]]) +-------- + +// no description + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`[opType=index]`:: +`String` -- Explicit operation type +Options::: + * `"index"` + * `"create"` + +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`id`:: +`String` -- Template ID + +link:#[back to top] + +[[api-reindex-2-4]] +=== `reindex` + +[source,js] +-------- +client.reindex([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/plugins/master/plugins-reindex.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`refresh`:: +`Boolean` -- Should the effected indexes be refreshed? +`[timeout=1m]`:: +`Date, Number` -- Time each individual bulk request should wait for shards that are unavailable. +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`waitForCompletion`:: +`Boolean` -- Should the request should block until the reindex is complete. +`requestsPerSecond`:: +`Number` -- The throttle for this request in sub-requests per second. 0 means set no throttle. + +link:#[back to top] + +[[api-reindexrethrottle-2-4]] +=== `reindexRethrottle` + +[source,js] +-------- +client.reindexRethrottle([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-reindex.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`requestsPerSecond`:: +`Number` -- The throttle to set on this request in sub-requests per second. 0 means set no throttle. As does "unlimited". Otherwise it must be a float. +`taskId`:: +`String` -- The task id to rethrottle + +link:#[back to top] + +[[api-rendersearchtemplate-2-4]] +=== `renderSearchTemplate` + +[source,js] +-------- +client.renderSearchTemplate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`id`:: +`String` -- The id of the stored search template + +link:#[back to top] + +[[api-scroll-2-4]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html[the elasticsearch docs] for more about 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`:: +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search +`scrollId`:: +`String` -- The scroll ID + +link:#[back to top] + +[[api-search-2-4]] +=== `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/fullscale/elastic.js[elastic.js], https://github.com/holidayextras/esq[esq], or https://github.com/danpaz/bodybuilder[bodybuilder] can be used to make building query bodies easier. + + + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html[the elasticsearch docs] for more about this method. + +.Search with a simple query string query +[source,js] +--------- +client.search({ + index: 'myindex', + q: 'title:test' +}, function (error, response) { + // ... +}); +--------- + +.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash` +[source,js] +--------- +client.search({ + index: 'myindex', + body: { + query: { + match: { + title: 'test' + } + }, + facets: { + tags: { + terms: { + field: 'tags' + } + } + } + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`explain`:: +`Boolean` -- Specify whether to return detailed information about score computation as part of a hit +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as part of a hit +`fielddataFields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as the field data representation of a field for each hit +`from`:: +`Number` -- Starting offset (default: 0) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`q`:: +`String` -- Query in the Lucene query string syntax +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`scroll`:: +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"dfs_query_then_fetch"` + * `"count"` + * `"scan"` + +`size`:: +`Number` -- Number of hits to return (default: 10) +`sort`:: +`String, String[], Boolean` -- A comma-separated list of : pairs +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`terminateAfter`:: +`Number` -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. +`stats`:: +`String, String[], Boolean` -- Specific 'tag' of the request for logging and statistical purposes +`suggestField`:: +`String` -- Specify which field to use for suggestions +`[suggestMode=missing]`:: +`String` -- Specify suggest mode +Options::: + * `"missing"` + * `"popular"` + * `"always"` + +`suggestSize`:: +`Number` -- How many suggestions to return in response +`suggestText`:: +`String` -- The source text for which the suggestions should be returned +`timeout`:: +`Date, Number` -- Explicit operation timeout +`trackScores`:: +`Boolean` -- Whether to calculate and return scores even if they are not used for sorting +`version`:: +`Boolean` -- Specify whether to return document version as part of a hit +`requestCache`:: +`Boolean` -- Specify if request cache should be used for this request or not, defaults to index level setting +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-searchexists-2-4]] +=== `searchExists` + +[source,js] +-------- +client.searchExists([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-exists.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`minScore`:: +`Number` -- Include only documents with a specific `_score` value in the result +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String` -- Specific routing value +`q`:: +`String` -- Query in the Lucene query string syntax +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`index`:: +`String, String[], Boolean` -- A comma-separated list of indices to restrict the results +`type`:: +`String, String[], Boolean` -- A comma-separated list of types to restrict the results + +link:#[back to top] + +[[api-searchshards-2-4]] +=== `searchShards` + +[source,js] +-------- +client.searchShards([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String` -- Specific routing value +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-searchtemplate-2-4]] +=== `searchTemplate` + +[source,js] +-------- +client.searchTemplate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`scroll`:: +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"query_and_fetch"` + * `"dfs_query_then_fetch"` + * `"dfs_query_and_fetch"` + * `"count"` + * `"scan"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-suggest-2-4]] +=== `suggest` + +[source,js] +-------- +client.suggest([params, [callback]]) +-------- + +The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-suggesters.html[the elasticsearch docs] for more about this method. + +.Return query terms suggestions (“auto-correction”) +[source,js] +--------- +client.suggest({ +index: 'myindex', +body: { + mysuggester: { + text: 'tset', + term: { + field: 'title' + } + } +} +}, function (error, response) { +// response will be formatted like so: +// +// { +// ... +// mysuggester: [ +// { +// text: "tset", +// ... +// options: [ +// { +// text: "test", +// score: 0.75, +// freq: 5 +// } +// ] +// } +// ] +// } +}); +--------- + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`routing`:: +`String` -- Specific routing value +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + +link:#[back to top] + +[[api-termvectors-2-4]] +=== `termvectors` + +[source,js] +-------- +client.termvectors([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`termStatistics`:: +`Boolean` -- Specifies if total term frequency and document frequency should be returned. +`[fieldStatistics=true]`:: +`Boolean` -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. +`dfs`:: +`Boolean` -- Specifies if distributed frequencies should be returned instead shard frequencies. +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return. +`[offsets=true]`:: +`Boolean` -- Specifies if term offsets should be returned. +`[positions=true]`:: +`Boolean` -- Specifies if term positions should be returned. +`[payloads=true]`:: +`Boolean` -- Specifies if term payloads should be returned. +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random). +`routing`:: +`String` -- Specific routing value. +`parent`:: +`String` -- Parent id of documents. +`realtime`:: +`Boolean` -- Specifies if request is real-time as opposed to near-real-time (default: true). +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"external"` + * `"external_gte"` + * `"force"` + +`index`:: +`String` -- The index in which the document resides. +`type`:: +`String` -- The type of the document. +`id`:: +`String` -- The id of the document, when not specified a doc param should be supplied. + +link:#[back to top] + +[[api-update-2-4]] +=== `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 + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html[the elasticsearch docs] for more about this method. + +.Update document title using partial document +[source,js] +--------- +client.update({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + // put the partial document under the `doc` key + doc: { + title: 'Updated' + } + } +}, function (error, response) { + // ... +}) +--------- + +.Add a tag to document `tags` property using a `script` +[source,js] +--------- +client.update({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + script: 'ctx._source.tags += tag', + params: { tag: 'some new tag' } + } +}, function (error, response) { + // ... +}); +--------- + +.Increment a document counter by 1 or initialize it, when the document does not exist +[source,js] +--------- +client.update({ + index: 'myindex', + type: 'mytype', + id: '777', + body: { + script: 'ctx._source.counter += 1', + upsert: { + counter: 1 + } + } +}, function (error, response) { + // ... +}) +--------- + +.Delete a document if it's tagged “to-delete” +[source,js] +--------- +client.update({ + index: 'myindex', + type: 'mytype', + id: '1', + body: { + script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"', + params: { + tag: 'to-delete' + } + } +}, function (error, response) { + // ... +}); +--------- + + +*Params* + +[horizontal] +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return in the response +`lang`:: +`String` -- The script language (default: groovy) +`parent`:: +`String` -- ID of the parent document. Is is only used for routing and when for the upsert request +`refresh`:: +`Boolean` -- Refresh the index after performing the operation +`retryOnConflict`:: +`Number` -- Specify how many times should the operation be retried when a conflict occurs (default: 0) +`routing`:: +`String` -- Specific routing value +`script`:: +`String` -- The URL-encoded script definition (instead of using request body) +`scriptId`:: +`String` -- The id of a stored script +`scriptedUpsert`:: +`Boolean` -- True if the script referenced in script or script_id should be called to perform inserts - defaults to false +`timeout`:: +`Date, Number` -- Explicit operation timeout +`timestamp`:: +`Date, Number` -- Explicit timestamp for the document +`ttl`:: +`Date, Number` -- Expiration time for the document +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type +Options::: + * `"internal"` + * `"force"` + +`id`:: +`String` -- Document ID +`index`:: +`String` -- The name of the index +`type`:: +`String` -- The type of the document + +link:#[back to top] + +[[api-updatebyquery-2-4]] +=== `updateByQuery` + +[source,js] +-------- +client.updateByQuery([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See https://www.elastic.co/guide/en/elasticsearch/plugins/master/plugins-reindex.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`explain`:: +`Boolean` -- Specify whether to return detailed information about score computation as part of a hit +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as part of a hit +`fielddataFields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return as the field data representation of a field for each hit +`from`:: +`Number` -- Starting offset (default: 0) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[conflicts=abort]`:: +`String` -- What to do when the reindex hits version conflicts? +Options::: + * `"abort"` + * `"proceed"` + +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`preference`:: +`String` -- Specify the node or shard the operation should be performed on (default: random) +`q`:: +`String` -- Query in the Lucene query string syntax +`routing`:: +`String, String[], Boolean` -- A comma-separated list of specific routing values +`scroll`:: +`Date, Number` -- Specify how long a consistent view of the index should be maintained for scrolled search +`searchType`:: +`String` -- Search operation type +Options::: + * `"query_then_fetch"` + * `"dfs_query_then_fetch"` + +`searchTimeout`:: +`Date, Number` -- Explicit timeout for each search request. Defaults to no timeout. +`size`:: +`Number` -- Number of hits to return (default: 10) +`sort`:: +`String, String[], Boolean` -- A comma-separated list of : pairs +`_source`:: +`String, String[], Boolean` -- True or false to return the _source field or not, or a list of fields to return +`_sourceExclude`:: +`String, String[], Boolean` -- A list of fields to exclude from the returned _source field +`_sourceInclude`:: +`String, String[], Boolean` -- A list of fields to extract and return from the _source field +`terminateAfter`:: +`Number` -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. +`stats`:: +`String, String[], Boolean` -- Specific 'tag' of the request for logging and statistical purposes +`suggestField`:: +`String` -- Specify which field to use for suggestions +`[suggestMode=missing]`:: +`String` -- Specify suggest mode +Options::: + * `"missing"` + * `"popular"` + * `"always"` + +`suggestSize`:: +`Number` -- How many suggestions to return in response +`suggestText`:: +`String` -- The source text for which the suggestions should be returned +`[timeout=1m]`:: +`Date, Number` -- Time each individual bulk request should wait for shards that are unavailable. +`trackScores`:: +`Boolean` -- Whether to calculate and return scores even if they are not used for sorting +`version`:: +`Boolean` -- Specify whether to return document version as part of a hit +`versionType`:: +`Boolean` -- Should the document increment the version number (internal) on hit or not (reindex) +`requestCache`:: +`Boolean` -- Specify if request cache should be used for this request or not, defaults to index level setting +`refresh`:: +`Boolean` -- Should the effected indexes be refreshed? +`consistency`:: +`String` -- Explicit write consistency setting for the operation +Options::: + * `"one"` + * `"quorum"` + * `"all"` + +`scrollSize`:: +`Number` -- Size on the scroll request powering the update_by_query +`waitForCompletion`:: +`Boolean` -- Should the request should block until the reindex is complete. +`requestsPerSecond`:: +`Number` -- The throttle for this request in sub-requests per second. 0 means set no throttle. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-cat-aliases-2-4]] +=== `cat.aliases` + +[source,js] +-------- +client.cat.aliases([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to return + +link:#[back to top] + +[[api-cat-allocation-2-4]] +=== `cat.allocation` + +[source,js] +-------- +client.cat.allocation([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +Options::: + * `"b"` + * `"k"` + * `"m"` + * `"g"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information + +link:#[back to top] + +[[api-cat-count-2-4]] +=== `cat.count` + +[source,js] +-------- +client.cat.count([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-fielddata-2-4]] +=== `cat.fielddata` + +[source,js] +-------- +client.cat.fielddata([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +Options::: + * `"b"` + * `"k"` + * `"m"` + * `"g"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to return the fielddata size + +link:#[back to top] + +[[api-cat-health-2-4]] +=== `cat.health` + +[source,js] +-------- +client.cat.health([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`[ts=true]`:: +`Boolean` -- Set to false to disable timestamping +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-help-2-4]] +=== `cat.help` + +[source,js] +-------- +client.cat.help([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`help`:: +`Boolean` -- Return help information + +link:#[back to top] + +[[api-cat-indices-2-4]] +=== `cat.indices` + +[source,js] +-------- +client.cat.indices([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +Options::: + * `"b"` + * `"k"` + * `"m"` + * `"g"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`pri`:: +`Boolean` -- Set to true to return stats only for primary shards +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-master-2-4]] +=== `cat.master` + +[source,js] +-------- +client.cat.master([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-nodeattrs-2-4]] +=== `cat.nodeattrs` + +[source,js] +-------- +client.cat.nodeattrs([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-nodes-2-4]] +=== `cat.nodes` + +[source,js] +-------- +client.cat.nodes([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-pendingtasks-2-4]] +=== `cat.pendingTasks` + +[source,js] +-------- +client.cat.pendingTasks([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-plugins-2-4]] +=== `cat.plugins` + +[source,js] +-------- +client.cat.plugins([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-recovery-2-4]] +=== `cat.recovery` + +[source,js] +-------- +client.cat.recovery([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +Options::: + * `"b"` + * `"k"` + * `"m"` + * `"g"` + +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-repositories-2-4]] +=== `cat.repositories` + +[source,js] +-------- +client.cat.repositories([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +link:#[back to top] + +[[api-cat-segments-2-4]] +=== `cat.segments` + +[source,js] +-------- +client.cat.segments([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-shards-2-4]] +=== `cat.shards` + +[source,js] +-------- +client.cat.shards([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +link:#[back to top] + +[[api-cat-snapshots-2-4]] +=== `cat.snapshots` + +[source,js] +-------- +client.cat.snapshots([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Set to true to ignore unavailable snapshots +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`repository`:: +`String, String[], Boolean` -- Name of repository from which to fetch the snapshot information + +link:#[back to top] + +[[api-cat-threadpool-2-4]] +=== `cat.threadPool` + +[source,js] +-------- +client.cat.threadPool([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`fullId`:: +`Boolean` -- Enables displaying the complete node ids + +link:#[back to top] + +[[api-cluster-getsettings-2-4]] +=== `cluster.getSettings` + +[source,js] +-------- +client.cluster.getSettings([params, [callback]]) +-------- + +Get cluster settings (previously set with `putSettings()`) + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout + +link:#[back to top] + +[[api-cluster-health-2-4]] +=== `cluster.health` + +[source,js] +-------- +client.cluster.health([params, [callback]]) +-------- + +Get a very simple status on the health of the cluster. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`[level=cluster]`:: +`String` -- Specify the level of detail for returned information +Options::: + * `"cluster"` + * `"indices"` + * `"shards"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`waitForActiveShards`:: +`Number` -- Wait until the specified number of shards is active +`waitForNodes`:: +`String` -- Wait until the specified number of nodes is available +`waitForRelocatingShards`:: +`Number` -- Wait until the specified number of relocating shards is finished +`waitForStatus`:: +`String` -- Wait until cluster is in a specific state +Options::: + * `"green"` + * `"yellow"` + * `"red"` + +`index`:: +`String, String[], Boolean` -- Limit the information returned to a specific index + +link:#[back to top] + +[[api-cluster-pendingtasks-2-4]] +=== `cluster.pendingTasks` + +[source,js] +-------- +client.cluster.pendingTasks([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master + +link:#[back to top] + +[[api-cluster-putsettings-2-4]] +=== `cluster.putSettings` + +[source,js] +-------- +client.cluster.putSettings([params, [callback]]) +-------- + +Update cluster wide specific settings. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout + +link:#[back to top] + +[[api-cluster-reroute-2-4]] +=== `cluster.reroute` + +[source,js] +-------- +client.cluster.reroute([params, [callback]]) +-------- + +Explicitly execute a cluster reroute allocation command including specific commands. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`dryRun`:: +`Boolean` -- Simulate the operation only and return the resulting state +`explain`:: +`Boolean` -- Return an explanation of why the commands can or cannot be executed +`metric`:: +`String, String[], Boolean` -- Limit the information returned to the specified metrics. Defaults to all but metadata +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout + +link:#[back to top] + +[[api-cluster-state-2-4]] +=== `cluster.state` + +[source,js] +-------- +client.cluster.state([params, [callback]]) +-------- + +Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices +`metric`:: +`String, String[], Boolean` -- Limit the information returned to the specified metrics + +link:#[back to top] + +[[api-cluster-stats-2-4]] +=== `cluster.stats` + +[source,js] +-------- +client.cluster.stats([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`timeout`:: +`Date, Number` -- Explicit operation timeout +`nodeId`:: +`String, String[], 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-2-4]] +=== `indices.analyze` + +[source,js] +-------- +client.indices.analyze([params, [callback]]) +-------- + +Perform the analysis process on a text and return the tokens breakdown of the text. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`analyzer`:: +`String` -- The name of the analyzer to use +`charFilters`:: +`String, String[], Boolean` -- Deprecated : A comma-separated list of character filters to use for the analysis +`charFilter`:: +`String, String[], Boolean` -- A comma-separated list of character filters to use for the analysis +`field`:: +`String` -- Use the analyzer configured for this field (instead of passing the analyzer name) +`filters`:: +`String, String[], Boolean` -- Deprecated : A comma-separated list of filters to use for the analysis +`filter`:: +`String, String[], Boolean` -- A comma-separated list of filters to use for the analysis +`index`:: +`String` -- The name of the index to scope the operation +`preferLocal`:: +`Boolean` -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) +`text`:: +`String, String[], Boolean` -- The text on which the analysis should be performed (when request body is not used) +`tokenizer`:: +`String` -- The name of the tokenizer to use for the analysis +`explain`:: +`Boolean` -- With `true`, outputs more advanced details. (default: false) +`attributes`:: +`String, String[], Boolean` -- A comma-separated list of token attributes to output, this parameter works only with `explain=true` +`[format=detailed]`:: +`String` -- Format of the output +Options::: + * `"detailed"` + * `"text"` + + +link:#[back to top] + +[[api-indices-clearcache-2-4]] +=== `indices.clearCache` + +[source,js] +-------- +client.indices.clearCache([params, [callback]]) +-------- + +Clear either all caches or specific cached associated with one ore more indices. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`fieldData`:: +`Boolean` -- Clear field data +`fielddata`:: +`Boolean` -- Clear field data +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all) +`query`:: +`Boolean` -- Clear query caches +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index name to limit the operation +`recycler`:: +`Boolean` -- Clear the recycler cache +`request`:: +`Boolean` -- Clear request cache + +link:#[back to top] + +[[api-indices-close-2-4]] +=== `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. + + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma separated list of indices to close + +link:#[back to top] + +[[api-indices-create-2-4]] +=== `indices.create` + +[source,js] +-------- +client.indices.create([params, [callback]]) +-------- + +Create an index in Elasticsearch. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`updateAllTypes`:: +`Boolean` -- Whether to update the mapping for all fields with the same name across all types or not +`index`:: +`String` -- The name of the index + +link:#[back to top] + +[[api-indices-delete-2-4]] +=== `indices.delete` + +[source,js] +-------- +client.indices.delete([params, [callback]]) +-------- + +Delete an index in Elasticsearch + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`index`:: +`String, String[], Boolean` -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices + +link:#[back to top] + +[[api-indices-deletealias-2-4]] +=== `indices.deleteAlias` + +[source,js] +-------- +client.indices.deleteAlias([params, [callback]]) +-------- + +Delete a specific alias. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit timestamp for the document +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names (supports wildcards); use `_all` for all indices +`name`:: +`String, String[], Boolean` -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. + +link:#[back to top] + +[[api-indices-deletetemplate-2-4]] +=== `indices.deleteTemplate` + +[source,js] +-------- +client.indices.deleteTemplate([params, [callback]]) +-------- + +Delete an index template by its name. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`name`:: +`String` -- The name of the template + +link:#[back to top] + +[[api-indices-deletewarmer-2-4]] +=== `indices.deleteWarmer` + +[source,js] +-------- +client.indices.deleteWarmer([params, [callback]]) +-------- + +Delete an index warmer. + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-warmers.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`name`:: +`String, String[], 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`:: +`String, String[], Boolean` -- A comma-separated list of index names to delete warmers from (supports wildcards); use `_all` to perform the operation on all indices. + +link:#[back to top] + +[[api-indices-exists-2-4]] +=== `indices.exists` + +[source,js] +-------- +client.indices.exists([params, [callback]]) +-------- + +Return a boolean indicating whether given index exists. + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of indices to check + +link:#[back to top] + +[[api-indices-existsalias-2-4]] +=== `indices.existsAlias` + +[source,js] +-------- +client.indices.existsAlias([params, [callback]]) +-------- + +Return a boolean indicating whether given alias exists. + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open,closed]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to filter aliases +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to return + +link:#[back to top] + +[[api-indices-existstemplate-2-4]] +=== `indices.existsTemplate` + +[source,js] +-------- +client.indices.existsTemplate([params, [callback]]) +-------- + +// no description + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`name`:: +`String` -- The name of the template + +link:#[back to top] + +[[api-indices-existstype-2-4]] +=== `indices.existsType` + +[source,js] +-------- +client.indices.existsType([params, [callback]]) +-------- + +Check if a type/types exists in an index/indices. + +The default method is `HEAD` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` to check the types across all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to check + +link:#[back to top] + +[[api-indices-flush-2-4]] +=== `indices.flush` + +[source,js] +-------- +client.indices.flush([params, [callback]]) +-------- + +Explicitly flush one or more indices. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`force`:: +`Boolean` -- Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) +`waitIfOngoing`:: +`Boolean` -- If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is false and will cause an exception to be thrown on the shard level if another flush operation is already running. +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string for all indices + +link:#[back to top] + +[[api-indices-flushsynced-2-4]] +=== `indices.flushSynced` + +[source,js] +-------- +client.indices.flushSynced([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string for all indices + +link:#[back to top] + +[[api-indices-forcemerge-2-4]] +=== `indices.forcemerge` + +[source,js] +-------- +client.indices.forcemerge([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flush`:: +`Boolean` -- Specify whether the index should be flushed after performing the operation (default: true) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`maxNumSegments`:: +`Number` -- The number of segments the index should be merged into (default: dynamic) +`onlyExpungeDeletes`:: +`Boolean` -- Specify whether the operation should only expunge deleted documents +`operationThreading`:: +`Anything` -- TODO: ? +`waitForMerge`:: +`Boolean` -- Specify whether the request should block until the merge process is finished (default: true) +`index`:: +`String, String[], 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-get-2-4]] +=== `indices.get` + +[source,js] +-------- +client.indices.get([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`ignoreUnavailable`:: +`Boolean` -- Ignore unavailable indexes (default: false) +`allowNoIndices`:: +`Boolean` -- Ignore if a wildcard expression resolves to no concrete indices (default: false) +`[expandWildcards=open]`:: +`String` -- Whether wildcard expressions should get expanded to open or closed indices (default: open) +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`human`:: +`Boolean` -- Whether to return version and creation date values in human-readable format. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names +`feature`:: +`String, String[], Boolean` -- A comma-separated list of features + +link:#[back to top] + +[[api-indices-getalias-2-4]] +=== `indices.getAlias` + +[source,js] +-------- +client.indices.getAlias([params, [callback]]) +-------- + +Retrieve a specified alias. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to filter aliases +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to return + +link:#[back to top] + +[[api-indices-getaliases-2-4]] +=== `indices.getAliases` + +[source,js] +-------- +client.indices.getAliases([params, [callback]]) +-------- + +Retrieve specified aliases + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to filter aliases +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to filter + +link:#[back to top] + +[[api-indices-getfieldmapping-2-4]] +=== `indices.getFieldMapping` + +[source,js] +-------- +client.indices.getFieldMapping([params, [callback]]) +-------- + +Retrieve mapping definition of a specific field. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`includeDefaults`:: +`Boolean` -- Whether the default mapping values should be returned as well +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields + +link:#[back to top] + +[[api-indices-getmapping-2-4]] +=== `indices.getMapping` + +[source,js] +-------- +client.indices.getMapping([params, [callback]]) +-------- + +Retrieve mapping definition of index or index/type. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types + +link:#[back to top] + +[[api-indices-getsettings-2-4]] +=== `indices.getSettings` + +[source,js] +-------- +client.indices.getSettings([params, [callback]]) +-------- + +Retrieve settings for one or more (or all) indices. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open,closed]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`human`:: +`Boolean` -- Whether to return version and creation date values in human-readable format. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices +`name`:: +`String, String[], Boolean` -- The name of the settings that should be included + +link:#[back to top] + +[[api-indices-gettemplate-2-4]] +=== `indices.getTemplate` + +[source,js] +-------- +client.indices.getTemplate([params, [callback]]) +-------- + +Retrieve an index template by its name. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`name`:: +`String, String[], Boolean` -- The comma separated names of the index templates + +link:#[back to top] + +[[api-indices-getupgrade-2-4]] +=== `indices.getUpgrade` + +[source,js] +-------- +client.indices.getUpgrade([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`index`:: +`String, String[], 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-2-4]] +=== `indices.getWarmer` + +[source,js] +-------- +client.indices.getWarmer([params, [callback]]) +-------- + +Retreieve an index warmer. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-warmers.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to restrict the operation; use `_all` to perform the operation on all indices +`name`:: +`String, String[], Boolean` -- The name of the warmer (supports wildcards); leave empty to get all warmers +`type`:: +`String, String[], 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-2-4]] +=== `indices.open` + +[source,js] +-------- +client.indices.open([params, [callback]]) +-------- + +Open a closed index, making it available for search. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=closed]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`index`:: +`String, String[], Boolean` -- A comma separated list of indices to open + +link:#[back to top] + +[[api-indices-optimize-2-4]] +=== `indices.optimize` + +[source,js] +-------- +client.indices.optimize([params, [callback]]) +-------- + +Explicitly optimize one or more indices. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-optimize.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flush`:: +`Boolean` -- Specify whether the index should be flushed after performing the operation (default: true) +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`maxNumSegments`:: +`Number` -- The number of segments the index should be merged into (default: dynamic) +`onlyExpungeDeletes`:: +`Boolean` -- Specify whether the operation should only expunge deleted documents +`operationThreading`:: +`Anything` -- TODO: ? +`waitForMerge`:: +`Boolean` -- Specify whether the request should block until the merge process is finished (default: true) +`index`:: +`String, String[], 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-putalias-2-4]] +=== `indices.putAlias` + +[source,js] +-------- +client.indices.putAlias([params, [callback]]) +-------- + +Create an alias for a specific index/indices. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit timestamp for the document +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`index`:: +`String, String[], 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`:: +`String` -- The name of the alias to be created or updated + +link:#[back to top] + +[[api-indices-putmapping-2-4]] +=== `indices.putMapping` + +[source,js] +-------- +client.indices.putMapping([params, [callback]]) +-------- + +Register specific mapping definition for a specific type. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`updateAllTypes`:: +`Boolean` -- Whether to update the mapping for all fields with the same name across all types or not +`index`:: +`String, String[], 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`:: +`String` -- The name of the document type + +link:#[back to top] + +[[api-indices-putsettings-2-4]] +=== `indices.putSettings` + +[source,js] +-------- +client.indices.putSettings([params, [callback]]) +-------- + +Change specific index level settings in real time. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`index`:: +`String, String[], 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-puttemplate-2-4]] +=== `indices.putTemplate` + +[source,js] +-------- +client.indices.putTemplate([params, [callback]]) +-------- + +Create an index template that will automatically be applied to new indices created. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`order`:: +`Number` -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) +`create`:: +`Boolean` -- Whether the index template should only be added if new or can also replace an existing one +`timeout`:: +`Date, Number` -- Explicit operation timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`name`:: +`String` -- The name of the template + +link:#[back to top] + +[[api-indices-putwarmer-2-4]] +=== `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. + +The default method is `PUT` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-warmers.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) in the search request to warm +`allowNoIndices`:: +`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]`:: +`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"` + +`requestCache`:: +`Boolean` -- Specify whether the request to be warmed should use the request cache, defaults to index level setting +`index`:: +`String, String[], 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`:: +`String` -- The name of the warmer +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to register the warmer for; leave empty to perform the operation on all types + +link:#[back to top] + +[[api-indices-recovery-2-4]] +=== `indices.recovery` + +[source,js] +-------- +client.indices.recovery([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`detailed`:: +`Boolean` -- Whether to display detailed information about shard recovery +`activeOnly`:: +`Boolean` -- Display only those recoveries that are currently on-going +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`index`:: +`String, String[], 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-2-4]] +=== `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. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`force`:: +`Boolean` -- Force a refresh even if not required +`operationThreading`:: +`Anything` -- TODO: ? +`index`:: +`String, String[], 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-segments-2-4]] +=== `indices.segments` + +[source,js] +-------- +client.indices.segments([params, [callback]]) +-------- + +Retrieve low level segments information that a Lucene index (shard level) is built with. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`operationThreading`:: +`Anything` -- TODO: ? +`verbose`:: +`Boolean` -- Includes detailed memory usage by Lucene. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + +link:#[back to top] + +[[api-indices-shardstores-2-4]] +=== `indices.shardStores` + +[source,js] +-------- +client.indices.shardStores([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`status`:: +`String, String[], Boolean` -- A comma-separated list of statuses used to filter on shards to get store information for +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`operationThreading`:: +`Anything` -- TODO: ? +`index`:: +`String, String[], 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-2-4]] +=== `indices.stats` + +[source,js] +-------- +client.indices.stats([params, [callback]]) +-------- + +Retrieve statistics on different operations happening on an index. + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`completionFields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) +`fielddataFields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) +`groups`:: +`String, String[], Boolean` -- A comma-separated list of search groups for `search` index metric +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`[level=indices]`:: +`String` -- Return stats aggregated at cluster, index or shard level +Options::: + * `"cluster"` + * `"indices"` + * `"shards"` + +`types`:: +`String, String[], Boolean` -- A comma-separated list of document types for the `indexing` index metric +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices +`metric`:: +`String, String[], Boolean` -- Limit the information returned the specific metrics. + +link:#[back to top] + +[[api-indices-updatealiases-2-4]] +=== `indices.updateAliases` + +[source,js] +-------- +client.indices.updateAliases([params, [callback]]) +-------- + +Update specified aliases. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html[the elasticsearch docs] for more about this method. + +.Perform an atomic alias swap, for a rotating index +[source,js] +--------- +client.indices.updateAliases({ + body: { + actions: [ + { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } }, + { add: { index: 'logstash-2014.05', alias: 'logstash-current' } } + ] + } +}).then(function (response) { + // ... +}, errorHandler); +--------- + + +*Params* + +[horizontal] +`timeout`:: +`Date, Number` -- Request timeout +`masterTimeout`:: +`Date, Number` -- Specify timeout for connection to master + +link:#[back to top] + +[[api-indices-upgrade-2-4]] +=== `indices.upgrade` + +[source,js] +-------- +client.indices.upgrade([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`waitForCompletion`:: +`Boolean` -- Specify whether the request should block until the all segments are upgraded (default: false) +`onlyAncientSegments`:: +`Boolean` -- If true, only ancient (an older Lucene major release) segments will be upgraded +`index`:: +`String, String[], 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-validatequery-2-4]] +=== `indices.validateQuery` + +[source,js] +-------- +client.indices.validateQuery([params, [callback]]) +-------- + +Validate a potentially expensive query without executing it. + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`explain`:: +`Boolean` -- Return detailed information about the error +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + * `"none"` + * `"all"` + +`operationThreading`:: +`Anything` -- TODO: ? +`q`:: +`String` -- Query in the Lucene query string syntax +`analyzer`:: +`String` -- The analyzer to use for the query string +`analyzeWildcard`:: +`Boolean` -- Specify whether wildcard and prefix queries should be analyzed (default: false) +`[defaultOperator=OR]`:: +`String` -- The default operator for query string query (AND or OR) +Options::: + * `"AND"` + * `"OR"` + +`df`:: +`String` -- The field to use as default where no field prefix is given in the query string +`lenient`:: +`Boolean` -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored +`lowercaseExpandedTerms`:: +`Boolean` -- Specify whether query terms should be lowercased +`rewrite`:: +`Boolean` -- Provide a more detailed explanation showing the actual Lucene query that will be executed. +`index`:: +`String, String[], 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`:: +`String, String[], 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-nodes-hotthreads-2-4]] +=== `nodes.hotThreads` + +[source,js] +-------- +client.nodes.hotThreads([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`interval`:: +`Date, Number` -- The interval for the second sampling of threads +`snapshots`:: +`Number` -- Number of samples of thread stacktrace (default: 10) +`threads`:: +`Number` -- Specify the number of threads to provide information for (default: 3) +`ignoreIdleThreads`:: +`Boolean` -- Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) +`type`:: +`String` -- The type to sample (default: cpu) +Options::: + * `"cpu"` + * `"wait"` + * `"block"` + +`timeout`:: +`Date, Number` -- Explicit operation timeout +`nodeId`:: +`String, String[], 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-2-4]] +=== `nodes.info` + +[source,js] +-------- +client.nodes.info([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`timeout`:: +`Date, Number` -- Explicit operation timeout +`nodeId`:: +`String, String[], 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`:: +`String, String[], Boolean` -- A comma-separated list of metrics you wish returned. Leave empty to return all. + +link:#[back to top] + +[[api-nodes-stats-2-4]] +=== `nodes.stats` + +[source,js] +-------- +client.nodes.stats([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`completionFields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) +`fielddataFields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) +`fields`:: +`String, String[], Boolean` -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) +`groups`:: +`Boolean` -- A comma-separated list of search groups for `search` index metric +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`[level=node]`:: +`String` -- Return indices stats aggregated at node, index or shard level +Options::: + * `"node"` + * `"indices"` + * `"shards"` + +`types`:: +`String, String[], Boolean` -- A comma-separated list of document types for the `indexing` index metric +`timeout`:: +`Date, Number` -- Explicit operation timeout +`metric`:: +`String, String[], Boolean` -- Limit the information returned to the specified metrics +`indexMetric`:: +`String, String[], 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`:: +`String, String[], 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-2-4]] +=== `snapshot.create` + +[source,js] +-------- +client.snapshot.create([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`waitForCompletion`:: +`Boolean` -- Should this request wait until the operation has completed before returning +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name + +link:#[back to top] + +[[api-snapshot-createrepository-2-4]] +=== `snapshot.createRepository` + +[source,js] +-------- +client.snapshot.createRepository([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`verify`:: +`Boolean` -- Whether to verify the repository after creation +`repository`:: +`String` -- A repository name + +link:#[back to top] + +[[api-snapshot-delete-2-4]] +=== `snapshot.delete` + +[source,js] +-------- +client.snapshot.delete([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name + +link:#[back to top] + +[[api-snapshot-deleterepository-2-4]] +=== `snapshot.deleteRepository` + +[source,js] +-------- +client.snapshot.deleteRepository([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`repository`:: +`String, String[], Boolean` -- A comma-separated list of repository names + +link:#[back to top] + +[[api-snapshot-get-2-4]] +=== `snapshot.get` + +[source,js] +-------- +client.snapshot.get([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String` -- A repository name +`snapshot`:: +`String, String[], Boolean` -- A comma-separated list of snapshot names + +link:#[back to top] + +[[api-snapshot-getrepository-2-4]] +=== `snapshot.getRepository` + +[source,js] +-------- +client.snapshot.getRepository([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`repository`:: +`String, String[], Boolean` -- A comma-separated list of repository names + +link:#[back to top] + +[[api-snapshot-restore-2-4]] +=== `snapshot.restore` + +[source,js] +-------- +client.snapshot.restore([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`waitForCompletion`:: +`Boolean` -- Should this request wait until the operation has completed before returning +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name + +link:#[back to top] + +[[api-snapshot-status-2-4]] +=== `snapshot.status` + +[source,js] +-------- +client.snapshot.status([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String` -- A repository name +`snapshot`:: +`String, String[], Boolean` -- A comma-separated list of snapshot names + +link:#[back to top] + +[[api-snapshot-verifyrepository-2-4]] +=== `snapshot.verifyRepository` + +[source,js] +-------- +client.snapshot.verifyRepository([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`repository`:: +`String` -- A repository name + +link:#[back to top] + +[[api-tasks-cancel-2-4]] +=== `tasks.cancel` + +[source,js] +-------- +client.tasks.cancel([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks-cancel.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes +`actions`:: +`String, String[], Boolean` -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all. +`parentNode`:: +`String` -- Cancel tasks with specified parent node. +`parentTask`:: +`String` -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. +`taskId`:: +`String` -- Cancel the task with specified id + +link:#[back to top] + +[[api-tasks-list-2-4]] +=== `tasks.list` + +[source,js] +-------- +client.tasks.list([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks-list.html[the elasticsearch docs] for more about this method. + +// no examples + + +*Params* + +[horizontal] +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes +`actions`:: +`String, String[], Boolean` -- A comma-separated list of actions that should be returned. Leave empty to return all. +`detailed`:: +`Boolean` -- Return detailed task information (default: false) +`parentNode`:: +`String` -- Return tasks with specified parent node. +`parentTask`:: +`String` -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. +`waitForCompletion`:: +`Boolean` -- Wait for the matching tasks to complete (default: false) +`taskId`:: +`String` -- Return the task with specified id (node_id:task_number) + +link:#[back to top] diff --git a/docs/configuration.asciidoc b/docs/configuration.asciidoc index d965eff29..f35875dc4 100644 --- a/docs/configuration.asciidoc +++ b/docs/configuration.asciidoc @@ -51,9 +51,11 @@ Default in Node::: + WARNING: This default will track the latest version of Elasticsearch, and is only intended to be used during development. It is highly recommended that you set this parameter in all code that is headed to production. -Default ::: `'2.3'` +Default ::: `'5.0'` Options in node ::: + * `'5.0'` + * `'2.4'` * `'2.3'` * `'2.2'` * `'2.1'` @@ -67,16 +69,16 @@ Options in node ::: * `'1.1'` * `'1.0'` * `'0.90'` - * `'2.4'` (unstable) + * `'5.x'` (unstable) * `'master'` (unstable) Options in the browser ::: + * `'5.0'` + * `'2.4'` * `'2.3'` * `'2.2'` * `'2.1'` - * `'2.0'` - * `'1.7'` - * `'2.4'` (unstable) + * `'5.x'` (unstable) * `'master'` (unstable) diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 682c87ac1..2aca64db9 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -22,6 +22,10 @@ include::development.asciidoc[] include::api_methods.asciidoc[] +include::api_methods_2_4.asciidoc[] + +include::api_methods_2_3.asciidoc[] + include::api_methods_2_2.asciidoc[] include::api_methods_2_1.asciidoc[] diff --git a/package.json b/package.json index 8680e3f48..a62b147cb 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,10 @@ "blanket": { "pattern": "specified in test/unit/coverage.js" }, - "default_api_branch": "2.3", + "default_api_branch": "5.0", "supported_es_branches": [ + "5.0", + "2.4", "2.3", "2.2", "2.1", @@ -35,7 +37,7 @@ "0.90" ], "unstable_es_branches": [ - "2.4", + "5.x", "master" ] }, @@ -111,4 +113,4 @@ "engines": { "node": ">=0.8" } -} \ No newline at end of file +} diff --git a/src/lib/apis/0_90.js b/src/lib/apis/0_90.js index e2862baea..837fe823c 100644 --- a/src/lib/apis/0_90.js +++ b/src/lib/apis/0_90.js @@ -1044,7 +1044,7 @@ api.getSource = ca({ * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID @@ -1097,7 +1097,7 @@ api.index = ca({ type: 'time' }, ttl: { - type: 'duration' + type: 'time' }, version: { type: 'number' @@ -2871,13 +2871,13 @@ api.ping = ca({ * Perform a [scroll](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.scrollId - The scroll ID */ api.scroll = ca({ params: { scroll: { - type: 'duration' + type: 'time' }, scrollId: { type: 'string', @@ -2919,7 +2919,7 @@ api.scroll = ca({ * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String} params.q - Query in the Lucene query string syntax * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {Number} params.size - Number of hits to return (default: 10) * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs @@ -2931,7 +2931,7 @@ api.scroll = ca({ * @param {String} params.suggestField - Specify which field to use for suggestions * @param {String} [params.suggestMode=missing] - Specify suggest mode * @param {Number} params.suggestSize - How many suggestions to return in response - * @param {Text} params.suggestText - The source text for which the suggestions should be returned + * @param {String} params.suggestText - The source text for which the suggestions should be returned * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Boolean} params.version - Specify whether to return document version as part of a hit * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -2997,7 +2997,7 @@ api.search = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -3053,7 +3053,7 @@ api.search = ca({ name: 'suggest_size' }, suggestText: { - type: 'text', + type: 'string', name: 'suggest_text' }, timeout: { @@ -3150,10 +3150,10 @@ api.suggest = ca({ * @param {String} [params.replication=sync] - Specific replication type * @param {Number} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) * @param {String} params.routing - Specific routing value - * @param {Anything} params.script - The URL-encoded script definition (instead of using request body) + * @param {String} params.script - The URL-encoded script definition (instead of using request body) * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID @@ -3200,7 +3200,9 @@ api.update = ca({ routing: { type: 'string' }, - script: {}, + script: { + type: 'string' + }, timeout: { type: 'time' }, @@ -3208,7 +3210,7 @@ api.update = ca({ type: 'time' }, ttl: { - type: 'duration' + type: 'time' }, version: { type: 'number' @@ -3251,7 +3253,7 @@ api.update = ca({ * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID diff --git a/src/lib/apis/1_7.js b/src/lib/apis/1_7.js index 359575eee..a7434ae08 100644 --- a/src/lib/apis/1_7.js +++ b/src/lib/apis/1_7.js @@ -1993,7 +1993,7 @@ api.getTemplate = ca({ * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID @@ -2043,7 +2043,7 @@ api.index = ca({ type: 'time' }, ttl: { - type: 'duration' + type: 'time' }, version: { type: 'number' @@ -4614,7 +4614,6 @@ api.msearch = ca({ * @param {Boolean} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). * @param {String} params.index - The index in which the document resides. * @param {String} params.type - The type of the document. - * @param {String} params.id - The id of the document. */ api.mtermvectors = ca({ params: { @@ -5296,13 +5295,13 @@ api.putTemplate = ca({ * Perform a [scroll](http://www.elastic.co/guide/en/elasticsearch/reference/1.6/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.scrollId - The scroll ID */ api.scroll = ca({ params: { scroll: { - type: 'duration' + type: 'time' }, scrollId: { type: 'string', @@ -5346,7 +5345,7 @@ api.scroll = ca({ * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String} params.q - Query in the Lucene query string syntax * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {Number} params.size - Number of hits to return (default: 10) * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs @@ -5357,7 +5356,7 @@ api.scroll = ca({ * @param {String} params.suggestField - Specify which field to use for suggestions * @param {String} [params.suggestMode=missing] - Specify suggest mode * @param {Number} params.suggestSize - How many suggestions to return in response - * @param {Text} params.suggestText - The source text for which the suggestions should be returned + * @param {String} params.suggestText - The source text for which the suggestions should be returned * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting * @param {Boolean} params.version - Specify whether to return document version as part of a hit @@ -5435,7 +5434,7 @@ api.search = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -5488,7 +5487,7 @@ api.search = ca({ name: 'suggest_size' }, suggestText: { - type: 'text', + type: 'string', name: 'suggest_text' }, timeout: { @@ -5721,7 +5720,7 @@ api.searchShards = ca({ * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types @@ -5754,7 +5753,7 @@ api.searchTemplate = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -6257,12 +6256,12 @@ api.termvector = ca({ * @param {String} [params.replication=sync] - Specific replication type * @param {Number} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) * @param {String} params.routing - Specific routing value - * @param {Anything} params.script - The URL-encoded script definition (instead of using request body) - * @param {Anything} params.scriptId - The id of a stored script + * @param {String} params.script - The URL-encoded script definition (instead of using request body) + * @param {String} params.scriptId - The id of a stored script * @param {Boolean} params.scriptedUpsert - True if the script referenced in script or script_id should be called to perform inserts - defaults to false * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID @@ -6306,8 +6305,11 @@ api.update = ca({ routing: { type: 'string' }, - script: {}, + script: { + type: 'string' + }, scriptId: { + type: 'string', name: 'script_id' }, scriptedUpsert: { @@ -6321,7 +6323,7 @@ api.update = ca({ type: 'time' }, ttl: { - type: 'duration' + type: 'time' }, version: { type: 'number' @@ -6363,7 +6365,7 @@ api.update = ca({ * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID diff --git a/src/lib/apis/2_4.js b/src/lib/apis/2_4.js index f64a9492b..21c4a3334 100644 --- a/src/lib/apis/2_4.js +++ b/src/lib/apis/2_4.js @@ -11,7 +11,7 @@ var ca = require('../client_action').makeFactoryWithModifier(function (spec) { var namespace = require('../client_action').namespaceFactory; var api = module.exports = {}; -api._namespaces = ['cat', 'cluster', 'indices', 'nodes', 'reindex', 'snapshot', 'tasks']; +api._namespaces = ['cat', 'cluster', 'indices', 'nodes', 'snapshot', 'tasks']; /** * Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request @@ -1987,11 +1987,11 @@ api.getTemplate = ca({ * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation * @param {String} params.parent - ID of the parent document - * @param {Boolean} params.refresh - Refresh the index after performing the operation + * @param {Boolean} params.refresh - Refresh the affected shards after performing the operation * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID @@ -2033,7 +2033,7 @@ api.index = ca({ type: 'time' }, ttl: { - type: 'duration' + type: 'time' }, version: { type: 'number' @@ -5224,8 +5224,6 @@ api.putTemplate = ca({ method: 'PUT' }); -api.reindex = namespace(); - /** * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/plugins/master/plugins-reindex.html) request * @@ -5234,7 +5232,7 @@ api.reindex = namespace(); * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {String} params.consistency - Explicit write consistency setting for the operation * @param {Boolean} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {Float} params.requestsPerSecond - The throttle for this request in sub-requests per second. 0 means set no throttle. + * @param {Number} params.requestsPerSecond - The throttle for this request in sub-requests per second. 0 means set no throttle. */ api.reindex = ca({ params: { @@ -5259,7 +5257,7 @@ api.reindex = ca({ name: 'wait_for_completion' }, requestsPerSecond: { - type: 'float', + type: 'number', 'default': 0, name: 'requests_per_second' } @@ -5272,16 +5270,16 @@ api.reindex = ca({ }); /** - * Perform a [reindex.rethrottle](https://www.elastic.co/guide/en/elasticsearch/plugins/master/plugins-reindex.html) request + * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-reindex.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Float} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. 0 means set no throttle. As does "unlimited". Otherwise it must be a float. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. 0 means set no throttle. As does "unlimited". Otherwise it must be a float. * @param {String} params.taskId - The task id to rethrottle */ -api.reindex.prototype.rethrottle = ca({ +api.reindexRethrottle = ca({ params: { requestsPerSecond: { - type: 'float', + type: 'number', required: true, name: 'requests_per_second' } @@ -5324,13 +5322,13 @@ api.renderSearchTemplate = ca({ * Perform a [scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.scrollId - The scroll ID */ api.scroll = ca({ params: { scroll: { - type: 'duration' + type: 'time' }, scrollId: { type: 'string', @@ -5374,7 +5372,7 @@ api.scroll = ca({ * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String} params.q - Query in the Lucene query string syntax * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {Number} params.size - Number of hits to return (default: 10) * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs @@ -5386,7 +5384,7 @@ api.scroll = ca({ * @param {String} params.suggestField - Specify which field to use for suggestions * @param {String} [params.suggestMode=missing] - Specify suggest mode * @param {Number} params.suggestSize - How many suggestions to return in response - * @param {Text} params.suggestText - The source text for which the suggestions should be returned + * @param {String} params.suggestText - The source text for which the suggestions should be returned * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting * @param {Boolean} params.version - Specify whether to return document version as part of a hit @@ -5464,7 +5462,7 @@ api.search = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -5519,7 +5517,7 @@ api.search = ca({ name: 'suggest_size' }, suggestText: { - type: 'text', + type: 'string', name: 'suggest_text' }, timeout: { @@ -5752,7 +5750,7 @@ api.searchShards = ca({ * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types @@ -5785,7 +5783,7 @@ api.searchTemplate = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -6406,12 +6404,12 @@ api.termvectors = ca({ * @param {Boolean} params.refresh - Refresh the index after performing the operation * @param {Number} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) * @param {String} params.routing - Specific routing value - * @param {Anything} params.script - The URL-encoded script definition (instead of using request body) - * @param {Anything} params.scriptId - The id of a stored script + * @param {String} params.script - The URL-encoded script definition (instead of using request body) + * @param {String} params.scriptId - The id of a stored script * @param {Boolean} params.scriptedUpsert - True if the script referenced in script or script_id should be called to perform inserts - defaults to false * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID @@ -6447,8 +6445,11 @@ api.update = ca({ routing: { type: 'string' }, - script: {}, + script: { + type: 'string' + }, scriptId: { + type: 'string', name: 'script_id' }, scriptedUpsert: { @@ -6462,7 +6463,7 @@ api.update = ca({ type: 'time' }, ttl: { - type: 'duration' + type: 'time' }, version: { type: 'number' @@ -6514,7 +6515,7 @@ api.update = ca({ * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String} params.q - Query in the Lucene query string syntax * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {Date, Number} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. * @param {Number} params.size - Number of hits to return (default: 10) @@ -6527,7 +6528,7 @@ api.update = ca({ * @param {String} params.suggestField - Specify which field to use for suggestions * @param {String} [params.suggestMode=missing] - Specify suggest mode * @param {Number} params.suggestSize - How many suggestions to return in response - * @param {Text} params.suggestText - The source text for which the suggestions should be returned + * @param {String} params.suggestText - The source text for which the suggestions should be returned * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting * @param {Boolean} params.version - Specify whether to return document version as part of a hit @@ -6535,9 +6536,9 @@ api.update = ca({ * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting * @param {Boolean} params.refresh - Should the effected indexes be refreshed? * @param {String} params.consistency - Explicit write consistency setting for the operation - * @param {Integer} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {Number} params.scrollSize - Size on the scroll request powering the update_by_query * @param {Boolean} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {Float} params.requestsPerSecond - The throttle for this request in sub-requests per second. 0 means set no throttle. + * @param {Number} params.requestsPerSecond - The throttle for this request in sub-requests per second. 0 means set no throttle. * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -6619,7 +6620,7 @@ api.updateByQuery = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -6676,7 +6677,7 @@ api.updateByQuery = ca({ name: 'suggest_size' }, suggestText: { - type: 'text', + type: 'string', name: 'suggest_text' }, timeout: { @@ -6710,7 +6711,7 @@ api.updateByQuery = ca({ ] }, scrollSize: { - type: 'integer', + type: 'number', name: 'scroll_size' }, waitForCompletion: { @@ -6719,7 +6720,7 @@ api.updateByQuery = ca({ name: 'wait_for_completion' }, requestsPerSecond: { - type: 'float', + type: 'number', 'default': 0, name: 'requests_per_second' } @@ -6754,11 +6755,11 @@ api.updateByQuery = ca({ * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation * @param {String} params.parent - ID of the parent document - * @param {Boolean} params.refresh - Refresh the index after performing the operation + * @param {Boolean} params.refresh - Refresh the affected shards after performing the operation * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID diff --git a/src/lib/apis/5_0.js b/src/lib/apis/5_0.js new file mode 100644 index 000000000..fd7157329 --- /dev/null +++ b/src/lib/apis/5_0.js @@ -0,0 +1,7116 @@ +var ca = require('../client_action').makeFactoryWithModifier(function (spec) { + return require('../utils').merge(spec, { + params: { + filterPath: { + type: 'list', + name: 'filter_path' + } + } + }); +}); +var namespace = require('../client_action').namespaceFactory; +var api = module.exports = {}; + +api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; + +/** + * Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.type - Default document type for items which don't provide one + * @param {String, String[], Boolean} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request + * @param {String, String[], Boolean} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request + * @param {String, String[], Boolean} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.index - Default index for items which don't provide one + */ +api.bulk = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + type: { + type: 'string' + }, + fields: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + pipeline: { + type: 'string' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_bulk', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_bulk', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_bulk' + } + ], + needBody: true, + bulkBody: true, + method: 'POST' +}); + +api.cat = namespace(); + +/** + * Perform a [cat.aliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return + */ +api.cat.prototype.aliases = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/aliases/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/_cat/aliases' + } + ] +}); + +/** + * Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.bytes - The unit in which to display byte values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information + */ +api.cat.prototype.allocation = ca({ + params: { + format: { + type: 'string' + }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/allocation/<%=nodeId%>', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_cat/allocation' + } + ] +}); + +/** + * Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.count = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/count/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/count' + } + ] +}); + +/** + * Perform a [cat.fielddata](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.bytes - The unit in which to display byte values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return the fielddata size + */ +api.cat.prototype.fielddata = ca({ + params: { + format: { + type: 'string' + }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + }, + fields: { + type: 'list' + } + }, + urls: [ + { + fmt: '/_cat/fielddata/<%=fields%>', + req: { + fields: { + type: 'list' + } + } + }, + { + fmt: '/_cat/fielddata' + } + ] +}); + +/** + * Perform a [cat.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} [params.ts=true] - Set to false to disable timestamping + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.health = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + ts: { + type: 'boolean', + 'default': true + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/health' + } +}); + +/** + * Perform a [cat.help](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.help - Return help information + */ +api.cat.prototype.help = ca({ + params: { + help: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat' + } +}); + +/** + * Perform a [cat.indices](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.bytes - The unit in which to display byte values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {String} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.pri - Set to true to return stats only for primary shards + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.indices = ca({ + params: { + format: { + type: 'string' + }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'm', + 'g' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + health: { + type: 'enum', + 'default': null, + options: [ + 'green', + 'yellow', + 'red' + ] + }, + help: { + type: 'boolean', + 'default': false + }, + pri: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/indices/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/indices' + } + ] +}); + +/** + * Perform a [cat.master](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.master = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/master' + } +}); + +/** + * Perform a [cat.nodeattrs](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.nodeattrs = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/nodeattrs' + } +}); + +/** + * Perform a [cat.nodes](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.nodes = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/nodes' + } +}); + +/** + * Perform a [cat.pendingTasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.pendingTasks = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/pending_tasks' + } +}); + +/** + * Perform a [cat.plugins](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.plugins = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/plugins' + } +}); + +/** + * Perform a [cat.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.bytes - The unit in which to display byte values + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.recovery = ca({ + params: { + format: { + type: 'string' + }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/recovery/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/recovery' + } + ] +}); + +/** + * Perform a [cat.repositories](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.repositories = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean', + 'default': false + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/repositories' + } +}); + +/** + * Perform a [cat.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.segments = ca({ + params: { + format: { + type: 'string' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/segments/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/segments' + } + ] +}); + +/** + * Perform a [cat.shards](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.shards = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/shards/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/shards' + } + ] +}); + +/** + * Perform a [cat.snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.ignoreUnavailable - Set to true to ignore unavailable snapshots + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.repository - Name of repository from which to fetch the snapshot information + */ +api.cat.prototype.snapshots = ca({ + params: { + format: { + type: 'string' + }, + ignoreUnavailable: { + type: 'boolean', + 'default': false, + name: 'ignore_unavailable' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/snapshots/<%=repository%>', + req: { + repository: { + type: 'list' + } + } + }, + { + fmt: '/_cat/snapshots' + } + ] +}); + +/** + * Perform a [cat.tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String, String[], Boolean} params.nodeId - 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 + * @param {String, String[], Boolean} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. + * @param {Boolean} params.detailed - Return detailed task information (default: false) + * @param {String} params.parentNode - Return tasks with specified parent node. + * @param {Number} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.tasks = ca({ + params: { + format: { + type: 'string' + }, + nodeId: { + type: 'list', + name: 'node_id' + }, + actions: { + type: 'list' + }, + detailed: { + type: 'boolean' + }, + parentNode: { + type: 'string', + name: 'parent_node' + }, + parentTask: { + type: 'number', + name: 'parent_task' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/tasks' + } +}); + +/** + * Perform a [cat.threadPool](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.size - The multiplier in which to display values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output + */ +api.cat.prototype.threadPool = ca({ + params: { + format: { + type: 'string' + }, + size: { + type: 'enum', + options: [ + '', + 'k', + 'm', + 'g', + 't', + 'p' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + }, + threadPoolPatterns: { + type: 'list', + name: 'thread_pool_patterns' + } + }, + urls: [ + { + fmt: '/_cat/thread_pool/<%=threadPools%>', + req: { + threadPools: {} + } + }, + { + fmt: '/_cat/thread_pool' + } + ] +}); + +/** + * Perform a [clearScroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.scrollId - A comma-separated list of scroll IDs to clear + */ +api.clearScroll = ca({ + urls: [ + { + fmt: '/_search/scroll/<%=scrollId%>', + req: { + scrollId: { + type: 'list' + } + } + }, + { + fmt: '/_search/scroll' + } + ], + method: 'DELETE' +}); + +api.cluster = namespace(); + +/** + * Perform a [cluster.allocationExplain](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) + * @param {Boolean} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) + */ +api.cluster.prototype.allocationExplain = ca({ + params: { + includeYesDecisions: { + type: 'boolean', + name: 'include_yes_decisions' + }, + includeDiskInfo: { + type: 'boolean', + name: 'include_disk_info' + } + }, + url: { + fmt: '/_cluster/allocation/explain' + }, + method: 'POST' +}); + +/** + * Perform a [cluster.getSettings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Boolean} params.includeDefaults - Whether to return all default clusters setting. + */ +api.cluster.prototype.getSettings = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + }, + includeDefaults: { + type: 'boolean', + 'default': false, + name: 'include_defaults' + } + }, + url: { + fmt: '/_cluster/settings' + } +}); + +/** + * Perform a [cluster.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} [params.level=cluster] - Specify the level of detail for returned information + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.waitForActiveShards - Wait until the specified number of shards is active + * @param {String} params.waitForNodes - Wait until the specified number of nodes is available + * @param {String} params.waitForEvents - Wait until all currently queued events with the given priorty are processed + * @param {Boolean} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster + * @param {String} params.waitForStatus - Wait until cluster is in a specific state + * @param {String, String[], Boolean} params.index - Limit the information returned to a specific index + */ +api.cluster.prototype.health = ca({ + params: { + level: { + type: 'enum', + 'default': 'cluster', + options: [ + 'cluster', + 'indices', + 'shards' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + waitForNodes: { + type: 'string', + name: 'wait_for_nodes' + }, + waitForEvents: { + type: 'enum', + options: [ + 'immediate', + 'urgent', + 'high', + 'normal', + 'low', + 'languid' + ], + name: 'wait_for_events' + }, + waitForNoRelocatingShards: { + type: 'boolean', + name: 'wait_for_no_relocating_shards' + }, + waitForStatus: { + type: 'enum', + 'default': null, + options: [ + 'green', + 'yellow', + 'red' + ], + name: 'wait_for_status' + } + }, + urls: [ + { + fmt: '/_cluster/health/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cluster/health' + } + ] +}); + +/** + * Perform a [cluster.pendingTasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + */ +api.cluster.prototype.pendingTasks = ca({ + params: { + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_cluster/pending_tasks' + } +}); + +/** + * Perform a [cluster.putSettings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + */ +api.cluster.prototype.putSettings = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_cluster/settings' + }, + method: 'PUT' +}); + +/** + * Perform a [cluster.reroute](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.dryRun - Simulate the operation only and return the resulting state + * @param {Boolean} params.explain - Return an explanation of why the commands can or cannot be executed + * @param {Boolean} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures + * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + */ +api.cluster.prototype.reroute = ca({ + params: { + dryRun: { + type: 'boolean', + name: 'dry_run' + }, + explain: { + type: 'boolean' + }, + retryFailed: { + type: 'boolean', + name: 'retry_failed' + }, + metric: { + type: 'list', + options: [ + '_all', + 'blocks', + 'metadata', + 'nodes', + 'routing_table', + 'master_node', + 'version' + ] + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_cluster/reroute' + }, + method: 'POST' +}); + +/** + * Perform a [cluster.state](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics + */ +api.cluster.prototype.state = ca({ + params: { + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/_cluster/state/<%=metric%>/<%=index%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'blocks', + 'metadata', + 'nodes', + 'routing_table', + 'routing_nodes', + 'master_node', + 'version' + ] + }, + index: { + type: 'list' + } + } + }, + { + fmt: '/_cluster/state/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'blocks', + 'metadata', + 'nodes', + 'routing_table', + 'routing_nodes', + 'master_node', + 'version' + ] + } + } + }, + { + fmt: '/_cluster/state' + } + ] +}); + +/** + * Perform a [cluster.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.nodeId - 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 + */ +api.cluster.prototype.stats = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + human: { + type: 'boolean', + 'default': false + }, + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_cluster/stats/nodes/<%=nodeId%>', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_cluster/stats' + } + ] +}); + +/** + * Perform a [count](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Number} params.minScore - Include only documents with a specific `_score` value in the result + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.routing - Specific routing value + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String, String[], Boolean} params.index - A comma-separated list of indices to restrict the results + * @param {String, String[], Boolean} params.type - A comma-separated list of types to restrict the results + */ +api.count = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + minScore: { + type: 'number', + name: 'min_score' + }, + preference: { + type: 'string' + }, + routing: { + type: 'string' + }, + q: { + type: 'string' + }, + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_count', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_count', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_count' + } + ], + method: 'POST' +}); + +/** + * Perform a [countPercolate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.percolateIndex - The index to count percolate the document into. Defaults to index. + * @param {String} params.percolateType - The type to count percolate document into. Defaults to type. + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.index - The index of the document being count percolated. + * @param {String} params.type - The type of the document being count percolated. + * @param {String} params.id - 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. + */ +api.countPercolate = ca({ + params: { + routing: { + type: 'list' + }, + preference: { + type: 'string' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + percolateIndex: { + type: 'string', + name: 'percolate_index' + }, + percolateType: { + type: 'string', + name: 'percolate_type' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>/_percolate/count', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of the parent document + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.create = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + timestamp: { + type: 'time' + }, + ttl: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + }, + pipeline: { + type: 'string' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'POST' +}); + +/** + * Perform a [delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of parent document + * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api['delete'] = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return as part of a hit + * @param {String, String[], Boolean} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit + * @param {Number} params.from - Starting offset (default: 0) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.searchType - Search operation type + * @param {Date, Number} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. + * @param {Number} params.size - Number of hits to return (default: 10) + * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes + * @param {String} params.suggestField - Specify which field to use for suggestions + * @param {String} [params.suggestMode=missing] - Specify suggest mode + * @param {Number} params.suggestSize - How many suggestions to return in response + * @param {String} params.suggestText - The source text for which the suggestions should be returned + * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. + * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting + * @param {Boolean} params.version - Specify whether to return document version as part of a hit + * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {Boolean} params.refresh - Should the effected indexes be refreshed? + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {Number} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {Boolean} params.waitForCompletion - Should the request should block until the delete-by-query is complete. + * @param {Number} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means set no throttle. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.deleteByQuery = ca({ + params: { + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + explain: { + type: 'boolean' + }, + storedFields: { + type: 'list', + name: 'stored_fields' + }, + docvalueFields: { + type: 'list', + name: 'docvalue_fields' + }, + from: { + type: 'number' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + conflicts: { + type: 'enum', + 'default': 'abort', + options: [ + 'abort', + 'proceed' + ] + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + preference: { + type: 'string' + }, + q: { + type: 'string' + }, + routing: { + type: 'list' + }, + scroll: { + type: 'time' + }, + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'dfs_query_then_fetch' + ], + name: 'search_type' + }, + searchTimeout: { + type: 'time', + name: 'search_timeout' + }, + size: { + type: 'number' + }, + sort: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + terminateAfter: { + type: 'number', + name: 'terminate_after' + }, + stats: { + type: 'list' + }, + suggestField: { + type: 'string', + name: 'suggest_field' + }, + suggestMode: { + type: 'enum', + 'default': 'missing', + options: [ + 'missing', + 'popular', + 'always' + ], + name: 'suggest_mode' + }, + suggestSize: { + type: 'number', + name: 'suggest_size' + }, + suggestText: { + type: 'string', + name: 'suggest_text' + }, + timeout: { + type: 'time', + 'default': '1m' + }, + trackScores: { + type: 'boolean', + name: 'track_scores' + }, + version: { + type: 'boolean' + }, + requestCache: { + type: 'boolean', + name: 'request_cache' + }, + refresh: { + type: 'boolean' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + scrollSize: { + type: 'number', + name: 'scroll_size' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + }, + requestsPerSecond: { + type: 'number', + 'default': 0, + name: 'requests_per_second' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_delete_by_query', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_delete_by_query', + req: { + index: { + type: 'list' + } + } + } + ], + needBody: true, + method: 'POST' +}); + +/** + * Perform a [deleteScript](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Script ID + * @param {String} params.lang - Script language + */ +api.deleteScript = ca({ + url: { + fmt: '/_scripts/<%=lang%>/<%=id%>', + req: { + lang: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [deleteTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Template ID + */ +api.deleteTemplate = ca({ + url: { + fmt: '/_search/template/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.parent - The ID of the parent document + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode + * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation + * @param {String} params.routing - Specific routing value + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) + */ +api.exists = ca({ + params: { + parent: { + type: 'string' + }, + preference: { + type: 'string' + }, + realtime: { + type: 'boolean' + }, + refresh: { + type: 'boolean' + }, + routing: { + type: 'string' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'HEAD' +}); + +/** + * Perform a [explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) + * @param {String} params.analyzer - The analyzer for the query string query + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The default field for query string query (default: _all) + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String} params.parent - The ID of the parent document + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.explain = ca({ + params: { + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + analyzer: { + type: 'string' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + storedFields: { + type: 'list', + name: 'stored_fields' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + parent: { + type: 'string' + }, + preference: { + type: 'string' + }, + q: { + type: 'string' + }, + routing: { + type: 'string' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [fieldStats](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) + * @param {String} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.fieldStats = ca({ + params: { + fields: { + type: 'list' + }, + level: { + type: 'enum', + 'default': 'cluster', + options: [ + 'indices', + 'cluster' + ] + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/_field_stats', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_field_stats' + } + ], + method: 'POST' +}); + +/** + * Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response + * @param {String} params.parent - The ID of the parent document + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode + * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation + * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) + */ +api.get = ca({ + params: { + storedFields: { + type: 'list', + name: 'stored_fields' + }, + parent: { + type: 'string' + }, + preference: { + type: 'string' + }, + realtime: { + type: 'boolean' + }, + refresh: { + type: 'boolean' + }, + routing: { + type: 'string' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [getScript](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Script ID + * @param {String} params.lang - Script language + */ +api.getScript = ca({ + url: { + fmt: '/_scripts/<%=lang%>/<%=id%>', + req: { + lang: { + type: 'string' + }, + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [getSource](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.parent - The ID of the parent document + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode + * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation + * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types + */ +api.getSource = ca({ + params: { + parent: { + type: 'string' + }, + preference: { + type: 'string' + }, + realtime: { + type: 'boolean' + }, + refresh: { + type: 'boolean' + }, + routing: { + type: 'string' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [getTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Template ID + */ +api.getTemplate = ca({ + url: { + fmt: '/_search/template/<%=id%>', + req: { + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [index](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of the parent document + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.index = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + opType: { + type: 'enum', + 'default': 'index', + options: [ + 'index', + 'create' + ], + name: 'op_type' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + timestamp: { + type: 'time' + }, + ttl: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + }, + pipeline: { + type: 'string' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + } + ], + needBody: true, + method: 'POST' +}); + +api.indices = namespace(); + +/** + * Perform a [indices.analyze](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.analyzer - The name of the analyzer to use + * @param {String, String[], Boolean} params.charFilter - A comma-separated list of character filters to use for the analysis + * @param {String} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) + * @param {String, String[], Boolean} params.filter - A comma-separated list of filters to use for the analysis + * @param {String} params.index - The name of the index to scope the operation + * @param {Boolean} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) + * @param {String, String[], Boolean} params.text - The text on which the analysis should be performed (when request body is not used) + * @param {String} params.tokenizer - The name of the tokenizer to use for the analysis + * @param {Boolean} params.explain - With `true`, outputs more advanced details. (default: false) + * @param {String, String[], Boolean} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` + * @param {String} [params.format=detailed] - Format of the output + */ +api.indices.prototype.analyze = ca({ + params: { + analyzer: { + type: 'string' + }, + charFilter: { + type: 'list', + name: 'char_filter' + }, + field: { + type: 'string' + }, + filter: { + type: 'list' + }, + index: { + type: 'string' + }, + preferLocal: { + type: 'boolean', + name: 'prefer_local' + }, + text: { + type: 'list' + }, + tokenizer: { + type: 'string' + }, + explain: { + type: 'boolean' + }, + attributes: { + type: 'list' + }, + format: { + type: 'enum', + 'default': 'detailed', + options: [ + 'detailed', + 'text' + ] + } + }, + urls: [ + { + fmt: '/<%=index%>/_analyze', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_analyze' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.clearCache](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.fieldData - Clear field data + * @param {Boolean} params.fielddata - Clear field data + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) + * @param {Boolean} params.query - Clear query caches + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index name to limit the operation + * @param {Boolean} params.recycler - Clear the recycler cache + * @param {Boolean} params.request - Clear request cache + */ +api.indices.prototype.clearCache = ca({ + params: { + fieldData: { + type: 'boolean', + name: 'field_data' + }, + fielddata: { + type: 'boolean' + }, + fields: { + type: 'list' + }, + query: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + index: { + type: 'list' + }, + recycler: { + type: 'boolean' + }, + request: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_cache/clear', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cache/clear' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.close](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma separated list of indices to close + */ +api.indices.prototype.close = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + url: { + fmt: '/<%=index%>/_close', + req: { + index: { + type: 'list' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [indices.create](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not + * @param {String} params.index - The name of the index + */ +api.indices.prototype.create = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + updateAllTypes: { + type: 'boolean', + name: 'update_all_types' + } + }, + url: { + fmt: '/<%=index%>', + req: { + index: { + type: 'string' + } + } + }, + method: 'PUT' +}); + +/** + * Perform a [indices.delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String, String[], Boolean} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices + */ +api.indices.prototype['delete'] = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [indices.deleteAlias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit timestamp for the document + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String, String[], Boolean} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices + * @param {String, String[], Boolean} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. + */ +api.indices.prototype.deleteAlias = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/<%=index%>/_alias/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [indices.deleteTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String} params.name - The name of the template + */ +api.indices.prototype.deleteTemplate = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [indices.exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of indices to check + */ +api.indices.prototype.exists = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + url: { + fmt: '/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + method: 'HEAD' +}); + +/** + * Perform a [indices.existsAlias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases + * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return + */ +api.indices.prototype.existsAlias = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': [ + 'open', + 'closed' + ], + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_alias/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, + { + fmt: '/_alias/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_alias', + req: { + index: { + type: 'list' + } + } + } + ], + method: 'HEAD' +}); + +/** + * Perform a [indices.existsTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String} params.name - The name of the template + */ +api.indices.prototype.existsTemplate = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + local: { + type: 'boolean' + } + }, + url: { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + method: 'HEAD' +}); + +/** + * Perform a [indices.existsType](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` to check the types across all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to check + */ +api.indices.prototype.existsType = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + url: { + fmt: '/<%=index%>/_mapping/<%=type%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + method: 'HEAD' +}); + +/** + * Perform a [indices.flush](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.force - 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) + * @param {Boolean} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices + */ +api.indices.prototype.flush = ca({ + params: { + force: { + type: 'boolean' + }, + waitIfOngoing: { + type: 'boolean', + name: 'wait_if_ongoing' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/_flush', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_flush' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.flushSynced](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices + */ +api.indices.prototype.flushSynced = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/_flush/synced', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_flush/synced' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.forcemerge](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flush - Specify whether the index should be flushed after performing the operation (default: true) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Number} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) + * @param {Boolean} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents + * @param {Anything} params.operationThreading - TODO: ? + * @param {Boolean} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.forcemerge = ca({ + params: { + flush: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + maxNumSegments: { + type: 'number', + name: 'max_num_segments' + }, + onlyExpungeDeletes: { + type: 'boolean', + name: 'only_expunge_deletes' + }, + operationThreading: { + name: 'operation_threading' + }, + waitForMerge: { + type: 'boolean', + name: 'wait_for_merge' + } + }, + urls: [ + { + fmt: '/<%=index%>/_forcemerge', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_forcemerge' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Boolean} params.ignoreUnavailable - Ignore unavailable indexes (default: false) + * @param {Boolean} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) + * @param {String} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.human - Whether to return version and creation date values in human-readable format. + * @param {Boolean} params.includeDefaults - Whether to return all default setting for each of the indices. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names + * @param {String, String[], Boolean} params.feature - A comma-separated list of features + */ +api.indices.prototype.get = ca({ + params: { + local: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + human: { + type: 'boolean', + 'default': false + }, + includeDefaults: { + type: 'boolean', + 'default': false, + name: 'include_defaults' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=feature%>', + req: { + index: { + type: 'list' + }, + feature: { + type: 'list', + options: [ + '_settings', + '_mappings', + '_aliases' + ] + } + } + }, + { + fmt: '/<%=index%>', + req: { + index: { + type: 'list' + } + } + } + ] +}); + +/** + * Perform a [indices.getAlias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases + * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return + */ +api.indices.prototype.getAlias = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'all', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_alias/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, + { + fmt: '/_alias/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_alias', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_alias' + } + ] +}); + +/** + * Perform a [indices.getFieldMapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.includeDefaults - Whether the default mapping values should be returned as well + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names + * @param {String, String[], Boolean} params.type - A comma-separated list of document types + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields + */ +api.indices.prototype.getFieldMapping = ca({ + params: { + includeDefaults: { + type: 'boolean', + name: 'include_defaults' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + }, + fields: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_mapping/field/<%=fields%>', + req: { + index: { + type: 'list' + }, + fields: { + type: 'list' + } + } + }, + { + fmt: '/_mapping/<%=type%>/field/<%=fields%>', + req: { + type: { + type: 'list' + }, + fields: { + type: 'list' + } + } + }, + { + fmt: '/_mapping/field/<%=fields%>', + req: { + fields: { + type: 'list' + } + } + } + ] +}); + +/** + * Perform a [indices.getMapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names + * @param {String, String[], Boolean} params.type - A comma-separated list of document types + */ +api.indices.prototype.getMapping = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_mapping/<%=type%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_mapping', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_mapping/<%=type%>', + req: { + type: { + type: 'list' + } + } + }, + { + fmt: '/_mapping' + } + ] +}); + +/** + * Perform a [indices.getSettings](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Boolean} params.human - Whether to return version and creation date values in human-readable format. + * @param {Boolean} params.includeDefaults - Whether to return all default setting for each of the indices. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.name - The name of the settings that should be included + */ +api.indices.prototype.getSettings = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': [ + 'open', + 'closed' + ], + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + local: { + type: 'boolean' + }, + human: { + type: 'boolean', + 'default': false + }, + includeDefaults: { + type: 'boolean', + 'default': false, + name: 'include_defaults' + } + }, + urls: [ + { + fmt: '/<%=index%>/_settings/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_settings', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_settings/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/_settings' + } + ] +}); + +/** + * Perform a [indices.getTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.name - The comma separated names of the index templates + */ +api.indices.prototype.getTemplate = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/_template' + } + ] +}); + +/** + * Perform a [indices.getUpgrade](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.getUpgrade = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_upgrade', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_upgrade' + } + ] +}); + +/** + * Perform a [indices.open](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma separated list of indices to open + */ +api.indices.prototype.open = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'closed', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + url: { + fmt: '/<%=index%>/_open', + req: { + index: { + type: 'list' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [indices.putAlias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit timestamp for the document + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String, String[], Boolean} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. + * @param {String} params.name - The name of the alias to be created or updated + */ +api.indices.prototype.putAlias = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/<%=index%>/_alias/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'string' + } + } + }, + method: 'PUT' +}); + +/** + * Perform a [indices.putMapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not + * @param {String, String[], Boolean} params.index - 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. + * @param {String} params.type - The name of the document type + */ +api.indices.prototype.putMapping = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + updateAllTypes: { + type: 'boolean', + name: 'update_all_types' + } + }, + urls: [ + { + fmt: '/<%=index%>/_mapping/<%=type%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/_mapping/<%=type%>', + req: { + type: { + type: 'string' + } + } + } + ], + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [indices.putSettings](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.putSettings = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + preserveExisting: { + type: 'boolean', + name: 'preserve_existing' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + } + }, + urls: [ + { + fmt: '/<%=index%>/_settings', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_settings' + } + ], + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [indices.putTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Number} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) + * @param {Boolean} params.create - Whether the index template should only be added if new or can also replace an existing one + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {String} params.name - The name of the template + */ +api.indices.prototype.putTemplate = ca({ + params: { + order: { + type: 'number' + }, + create: { + type: 'boolean', + 'default': false + }, + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + } + }, + url: { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [indices.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.detailed - Whether to display detailed information about shard recovery + * @param {Boolean} params.activeOnly - Display only those recoveries that are currently on-going + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.recovery = ca({ + params: { + detailed: { + type: 'boolean', + 'default': false + }, + activeOnly: { + type: 'boolean', + 'default': false, + name: 'active_only' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_recovery', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_recovery' + } + ] +}); + +/** + * Perform a [indices.refresh](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.force - Force a refresh even if not required + * @param {Anything} params.operationThreading - TODO: ? + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.refresh = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + force: { + type: 'boolean', + 'default': false + }, + operationThreading: { + name: 'operation_threading' + } + }, + urls: [ + { + fmt: '/<%=index%>/_refresh', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_refresh' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.rollover](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. + * @param {String} params.alias - The name of the alias to rollover + * @param {String} params.newIndex - The name of the rollover index + */ +api.indices.prototype.rollover = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + } + }, + urls: [ + { + fmt: '/<%=alias%>/_rollover/<%=newIndex%>', + req: { + alias: { + type: 'string' + }, + newIndex: { + type: 'string' + } + } + }, + { + fmt: '/<%=alias%>/_rollover', + req: { + alias: { + type: 'string' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {Anything} params.operationThreading - TODO: ? + * @param {Boolean} params.verbose - Includes detailed memory usage by Lucene. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.segments = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + human: { + type: 'boolean', + 'default': false + }, + operationThreading: { + name: 'operation_threading' + }, + verbose: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_segments', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_segments' + } + ] +}); + +/** + * Perform a [indices.shardStores](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.status - A comma-separated list of statuses used to filter on shards to get store information for + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Anything} params.operationThreading - TODO: ? + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.shardStores = ca({ + params: { + status: { + type: 'list', + options: [ + 'green', + 'yellow', + 'red', + 'all' + ] + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + operationThreading: { + name: 'operation_threading' + } + }, + urls: [ + { + fmt: '/<%=index%>/_shard_stores', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_shard_stores' + } + ] +}); + +/** + * Perform a [indices.shrink](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. + * @param {String} params.index - The name of the source index to shrink + * @param {String} params.target - The name of the target index to shrink into + */ +api.indices.prototype.shrink = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + } + }, + url: { + fmt: '/<%=index%>/_shrink/<%=target%>', + req: { + index: { + type: 'string' + }, + target: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [indices.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * @param {String, String[], Boolean} params.groups - A comma-separated list of search groups for `search` index metric + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String} [params.level=indices] - Return stats aggregated at cluster, index or shard level + * @param {String, String[], Boolean} params.types - A comma-separated list of document types for the `indexing` index metric + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.metric - Limit the information returned the specific metrics. + */ +api.indices.prototype.stats = ca({ + params: { + completionFields: { + type: 'list', + name: 'completion_fields' + }, + fielddataFields: { + type: 'list', + name: 'fielddata_fields' + }, + fields: { + type: 'list' + }, + groups: { + type: 'list' + }, + human: { + type: 'boolean', + 'default': false + }, + level: { + type: 'enum', + 'default': 'indices', + options: [ + 'cluster', + 'indices', + 'shards' + ] + }, + types: { + type: 'list' + } + }, + urls: [ + { + fmt: '/<%=index%>/_stats/<%=metric%>', + req: { + index: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'query_cache', + 'flush', + 'get', + 'indexing', + 'merge', + 'percolate', + 'request_cache', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer', + 'suggest' + ] + } + } + }, + { + fmt: '/_stats/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'query_cache', + 'flush', + 'get', + 'indexing', + 'merge', + 'percolate', + 'request_cache', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer', + 'suggest' + ] + } + } + }, + { + fmt: '/<%=index%>/_stats', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_stats' + } + ] +}); + +/** + * Perform a [indices.updateAliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Request timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + */ +api.indices.prototype.updateAliases = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_aliases' + }, + needBody: true, + method: 'POST' +}); + +/** + * Perform a [indices.upgrade](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) + * @param {Boolean} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.upgrade = ca({ + params: { + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + waitForCompletion: { + type: 'boolean', + name: 'wait_for_completion' + }, + onlyAncientSegments: { + type: 'boolean', + name: 'only_ancient_segments' + } + }, + urls: [ + { + fmt: '/<%=index%>/_upgrade', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_upgrade' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.validateQuery](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.explain - Return detailed information about the error + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Anything} params.operationThreading - TODO: ? + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {Boolean} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types + */ +api.indices.prototype.validateQuery = ca({ + params: { + explain: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + operationThreading: { + name: 'operation_threading' + }, + q: { + type: 'string' + }, + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + rewrite: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_validate/query', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_validate/query', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_validate/query' + } + ], + method: 'POST' +}); + +/** + * Perform a [info](http://www.elastic.co/guide/) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.info = ca({ + url: { + fmt: '/' + } +}); + +api.ingest = namespace(); + +/** + * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.id - Pipeline ID + */ +api.ingest.prototype.deletePipeline = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_ingest/pipeline/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String} params.id - Comma separated list of pipeline ids. Wildcards supported + */ +api.ingest.prototype.getPipeline = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + urls: [ + { + fmt: '/_ingest/pipeline/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + { + fmt: '/_ingest/pipeline' + } + ] +}); + +/** + * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.id - Pipeline ID + */ +api.ingest.prototype.putPipeline = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_ingest/pipeline/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.verbose - Verbose mode. Display data output for each processor in executed pipeline + * @param {String} params.id - Pipeline ID + */ +api.ingest.prototype.simulate = ca({ + params: { + verbose: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_ingest/pipeline/<%=id%>/_simulate', + req: { + id: { + type: 'string' + } + } + }, + { + fmt: '/_ingest/pipeline/_simulate' + } + ], + needBody: true, + method: 'POST' +}); + +/** + * Perform a [mget](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode + * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.mget = ca({ + params: { + storedFields: { + type: 'list', + name: 'stored_fields' + }, + preference: { + type: 'string' + }, + realtime: { + type: 'boolean' + }, + refresh: { + type: 'boolean' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_mget', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_mget', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_mget' + } + ], + needBody: true, + method: 'POST' +}); + +/** + * Perform a [mpercolate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.index - The index of the document being count percolated to use as default + * @param {String} params.type - The type of the document being percolated to use as default. + */ +api.mpercolate = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_mpercolate', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_mpercolate', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_mpercolate' + } + ], + needBody: true, + bulkBody: true, + method: 'POST' +}); + +/** + * Perform a [msearch](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.searchType - Search operation type + * @param {Number} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to use as default + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to use as default + */ +api.msearch = ca({ + params: { + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'query_and_fetch', + 'dfs_query_then_fetch', + 'dfs_query_and_fetch' + ], + name: 'search_type' + }, + maxConcurrentSearches: { + type: 'number', + name: 'max_concurrent_searches' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_msearch', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_msearch', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_msearch' + } + ], + needBody: true, + bulkBody: true, + method: 'POST' +}); + +/** + * Perform a [msearchTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.searchType - Search operation type + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to use as default + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to use as default + */ +api.msearchTemplate = ca({ + params: { + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'query_and_fetch', + 'dfs_query_then_fetch', + 'dfs_query_and_fetch' + ], + name: 'search_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_msearch/template', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_msearch/template', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_msearch/template' + } + ], + needBody: true, + bulkBody: true, + method: 'POST' +}); + +/** + * Perform a [mtermvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body + * @param {Boolean} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} [params.fieldStatistics=true] - 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". + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {String} params.preference - 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". + * @param {String} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {String} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.index - The index in which the document resides. + * @param {String} params.type - The type of the document. + */ +api.mtermvectors = ca({ + params: { + ids: { + type: 'list', + required: false + }, + termStatistics: { + type: 'boolean', + 'default': false, + required: false, + name: 'term_statistics' + }, + fieldStatistics: { + type: 'boolean', + 'default': true, + required: false, + name: 'field_statistics' + }, + fields: { + type: 'list', + required: false + }, + offsets: { + type: 'boolean', + 'default': true, + required: false + }, + positions: { + type: 'boolean', + 'default': true, + required: false + }, + payloads: { + type: 'boolean', + 'default': true, + required: false + }, + preference: { + type: 'string', + required: false + }, + routing: { + type: 'string', + required: false + }, + parent: { + type: 'string', + required: false + }, + realtime: { + type: 'boolean', + required: false + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_mtermvectors', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_mtermvectors', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_mtermvectors' + } + ], + method: 'POST' +}); + +api.nodes = namespace(); + +/** + * Perform a [nodes.hotThreads](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.interval - The interval for the second sampling of threads + * @param {Number} params.snapshots - Number of samples of thread stacktrace (default: 10) + * @param {Number} params.threads - Specify the number of threads to provide information for (default: 3) + * @param {Boolean} params.ignoreIdleThreads - 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) + * @param {String} params.type - The type to sample (default: cpu) + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.nodeId - 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 + */ +api.nodes.prototype.hotThreads = ca({ + params: { + interval: { + type: 'time' + }, + snapshots: { + type: 'number' + }, + threads: { + type: 'number' + }, + ignoreIdleThreads: { + type: 'boolean', + name: 'ignore_idle_threads' + }, + type: { + type: 'enum', + options: [ + 'cpu', + 'wait', + 'block' + ] + }, + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/hotthreads', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/hotthreads' + } + ] +}); + +/** + * Perform a [nodes.info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.nodeId - 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 + * @param {String, String[], Boolean} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. + */ +api.nodes.prototype.info = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + human: { + type: 'boolean', + 'default': false + }, + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/<%=metric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + 'settings', + 'os', + 'process', + 'jvm', + 'thread_pool', + 'transport', + 'http', + 'plugins', + 'ingest' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + 'settings', + 'os', + 'process', + 'jvm', + 'thread_pool', + 'transport', + 'http', + 'plugins', + 'ingest' + ] + } + } + }, + { + fmt: '/_nodes' + } + ] +}); + +/** + * Perform a [nodes.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * @param {Boolean} params.groups - A comma-separated list of search groups for `search` index metric + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String} [params.level=node] - Return indices stats aggregated at index, node or shard level + * @param {String, String[], Boolean} params.types - A comma-separated list of document types for the `indexing` index metric + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics + * @param {String, String[], Boolean} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. + * @param {String, String[], Boolean} params.nodeId - 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 + */ +api.nodes.prototype.stats = ca({ + params: { + completionFields: { + type: 'list', + name: 'completion_fields' + }, + fielddataFields: { + type: 'list', + name: 'fielddata_fields' + }, + fields: { + type: 'list' + }, + groups: { + type: 'boolean' + }, + human: { + type: 'boolean', + 'default': false + }, + level: { + type: 'enum', + 'default': 'node', + options: [ + 'indices', + 'node', + 'shards' + ] + }, + types: { + type: 'list' + }, + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'os', + 'process', + 'thread_pool', + 'transport', + 'discovery' + ] + }, + indexMetric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'query_cache', + 'flush', + 'get', + 'indexing', + 'merge', + 'percolate', + 'request_cache', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer', + 'suggest' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'os', + 'process', + 'thread_pool', + 'transport', + 'discovery' + ] + } + } + }, + { + fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'os', + 'process', + 'thread_pool', + 'transport', + 'discovery' + ] + }, + indexMetric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'query_cache', + 'flush', + 'get', + 'indexing', + 'merge', + 'percolate', + 'request_cache', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer', + 'suggest' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>/stats', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/stats/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'os', + 'process', + 'thread_pool', + 'transport', + 'discovery' + ] + } + } + }, + { + fmt: '/_nodes/stats' + } + ] +}); + +/** + * Perform a [percolate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.percolateIndex - The index to percolate the document into. Defaults to index. + * @param {String} params.percolateType - The type to percolate document into. Defaults to type. + * @param {String} params.percolateRouting - The routing value to use when percolating the existing document. + * @param {String} params.percolatePreference - Which shard to prefer when executing the percolate request. + * @param {String} params.percolateFormat - Return an array of matching query IDs instead of objects + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.index - The index of the document being percolated. + * @param {String} params.type - The type of the document being percolated. + * @param {String} params.id - 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. + */ +api.percolate = ca({ + params: { + routing: { + type: 'list' + }, + preference: { + type: 'string' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + percolateIndex: { + type: 'string', + name: 'percolate_index' + }, + percolateType: { + type: 'string', + name: 'percolate_type' + }, + percolateRouting: { + type: 'string', + name: 'percolate_routing' + }, + percolatePreference: { + type: 'string', + name: 'percolate_preference' + }, + percolateFormat: { + type: 'enum', + options: [ + 'ids' + ], + name: 'percolate_format' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>/_percolate', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [ping](http://www.elastic.co/guide/) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.ping = ca({ + url: { + fmt: '/' + }, + requestTimeout: 3000, + method: 'HEAD' +}); + +/** + * Perform a [putScript](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Script ID + * @param {String} params.lang - Script language + */ +api.putScript = ca({ + url: { + fmt: '/_scripts/<%=lang%>/<%=id%>', + req: { + lang: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [putTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Template ID + */ +api.putTemplate = ca({ + url: { + fmt: '/_search/template/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.refresh - Should the effected indexes be refreshed? + * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {Boolean} params.waitForCompletion - Should the request should block until the reindex is complete. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. + */ +api.reindex = ca({ + params: { + refresh: { + type: 'boolean' + }, + timeout: { + type: 'time', + 'default': '1m' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + }, + requestsPerSecond: { + type: 'number', + 'default': 0, + name: 'requests_per_second' + } + }, + url: { + fmt: '/_reindex' + }, + needBody: true, + method: 'POST' +}); + +/** + * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Number} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * @param {String} params.taskId - The task id to rethrottle + */ +api.reindexRethrottle = ca({ + params: { + requestsPerSecond: { + type: 'number', + required: true, + name: 'requests_per_second' + } + }, + url: { + fmt: '/_reindex/<%=taskId%>/_rethrottle', + req: { + taskId: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [renderSearchTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - The id of the stored search template + */ +api.renderSearchTemplate = ca({ + urls: [ + { + fmt: '/_render/template/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + { + fmt: '/_render/template' + } + ], + method: 'POST' +}); + +/** + * Perform a [scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.scrollId - The scroll ID + */ +api.scroll = ca({ + params: { + scroll: { + type: 'time' + }, + scrollId: { + type: 'string', + name: 'scroll_id' + } + }, + urls: [ + { + fmt: '/_search/scroll/<%=scrollId%>', + req: { + scrollId: { + type: 'string' + } + } + }, + { + fmt: '/_search/scroll' + } + ], + paramAsBody: 'scrollId', + method: 'POST' +}); + +/** + * Perform a [search](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return as part of a hit + * @param {String, String[], Boolean} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit + * @param {Number} params.from - Starting offset (default: 0) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.searchType - Search operation type + * @param {Number} params.size - Number of hits to return (default: 10) + * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes + * @param {String} params.suggestField - Specify which field to use for suggestions + * @param {String} [params.suggestMode=missing] - Specify suggest mode + * @param {Number} params.suggestSize - How many suggestions to return in response + * @param {String} params.suggestText - The source text for which the suggestions should be returned + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting + * @param {Boolean} params.version - Specify whether to return document version as part of a hit + * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.search = ca({ + params: { + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + explain: { + type: 'boolean' + }, + storedFields: { + type: 'list', + name: 'stored_fields' + }, + docvalueFields: { + type: 'list', + name: 'docvalue_fields' + }, + fielddataFields: { + type: 'list', + name: 'fielddata_fields' + }, + from: { + type: 'number' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + preference: { + type: 'string' + }, + q: { + type: 'string' + }, + routing: { + type: 'list' + }, + scroll: { + type: 'time' + }, + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'dfs_query_then_fetch' + ], + name: 'search_type' + }, + size: { + type: 'number' + }, + sort: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + terminateAfter: { + type: 'number', + name: 'terminate_after' + }, + stats: { + type: 'list' + }, + suggestField: { + type: 'string', + name: 'suggest_field' + }, + suggestMode: { + type: 'enum', + 'default': 'missing', + options: [ + 'missing', + 'popular', + 'always' + ], + name: 'suggest_mode' + }, + suggestSize: { + type: 'number', + name: 'suggest_size' + }, + suggestText: { + type: 'string', + name: 'suggest_text' + }, + timeout: { + type: 'time' + }, + trackScores: { + type: 'boolean', + name: 'track_scores' + }, + version: { + type: 'boolean' + }, + requestCache: { + type: 'boolean', + name: 'request_cache' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_search', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_search', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_search' + } + ], + method: 'POST' +}); + +/** + * Perform a [searchShards](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.routing - Specific routing value + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.searchShards = ca({ + params: { + preference: { + type: 'string' + }, + routing: { + type: 'string' + }, + local: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_search_shards', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_search_shards', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_search_shards' + } + ], + method: 'POST' +}); + +/** + * Perform a [searchTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.searchType - Search operation type + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.searchTemplate = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + preference: { + type: 'string' + }, + routing: { + type: 'list' + }, + scroll: { + type: 'time' + }, + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'query_and_fetch', + 'dfs_query_then_fetch', + 'dfs_query_and_fetch' + ], + name: 'search_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_search/template', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_search/template', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_search/template' + } + ], + method: 'POST' +}); + +api.snapshot = namespace(); + +/** + * Perform a [snapshot.create](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.waitForCompletion - Should this request wait until the operation has completed before returning + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.snapshot.prototype.create = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [snapshot.createRepository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Boolean} params.verify - Whether to verify the repository after creation + * @param {String} params.repository - A repository name + */ +api.snapshot.prototype.createRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + }, + verify: { + type: 'boolean' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'string' + } + } + }, + needBody: true, + method: 'POST' +}); + +/** + * Perform a [snapshot.delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.snapshot.prototype['delete'] = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [snapshot.deleteRepository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.repository - A comma-separated list of repository names + */ +api.snapshot.prototype.deleteRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'list' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [snapshot.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * @param {String} params.repository - A repository name + * @param {String, String[], Boolean} params.snapshot - A comma-separated list of snapshot names + */ +api.snapshot.prototype.get = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'list' + } + } + } +}); + +/** + * Perform a [snapshot.getRepository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.repository - A comma-separated list of repository names + */ +api.snapshot.prototype.getRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'list' + } + } + }, + { + fmt: '/_snapshot' + } + ] +}); + +/** + * Perform a [snapshot.restore](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.waitForCompletion - Should this request wait until the operation has completed before returning + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.snapshot.prototype.restore = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [snapshot.status](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * @param {String} params.repository - A repository name + * @param {String, String[], Boolean} params.snapshot - A comma-separated list of snapshot names + */ +api.snapshot.prototype.status = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + } + }, + urls: [ + { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'list' + } + } + }, + { + fmt: '/_snapshot/<%=repository%>/_status', + req: { + repository: { + type: 'string' + } + } + }, + { + fmt: '/_snapshot/_status' + } + ] +}); + +/** + * Perform a [snapshot.verifyRepository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.repository - A repository name + */ +api.snapshot.prototype.verifyRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/_verify', + req: { + repository: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [suggest](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-suggesters.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + */ +api.suggest = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + preference: { + type: 'string' + }, + routing: { + type: 'string' + } + }, + urls: [ + { + fmt: '/<%=index%>/_suggest', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_suggest' + } + ], + needBody: true, + method: 'POST' +}); + +api.tasks = namespace(); + +/** + * Perform a [tasks.cancel](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.nodeId - 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 + * @param {String, String[], Boolean} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. + * @param {String} params.parentNode - Cancel tasks with specified parent node. + * @param {String} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. + * @param {String} params.taskId - Cancel the task with specified task id (node_id:task_number) + */ +api.tasks.prototype.cancel = ca({ + params: { + nodeId: { + type: 'list', + name: 'node_id' + }, + actions: { + type: 'list' + }, + parentNode: { + type: 'string', + name: 'parent_node' + }, + parentTask: { + type: 'string', + name: 'parent_task' + } + }, + urls: [ + { + fmt: '/_tasks/<%=taskId%>/_cancel', + req: { + taskId: { + type: 'string' + } + } + }, + { + fmt: '/_tasks/_cancel' + } + ], + method: 'POST' +}); + +/** + * Perform a [tasks.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.waitForCompletion - Wait for the matching tasks to complete (default: false) + * @param {String} params.taskId - Return the task with specified id (node_id:task_number) + */ +api.tasks.prototype.get = ca({ + params: { + waitForCompletion: { + type: 'boolean', + name: 'wait_for_completion' + } + }, + url: { + fmt: '/_tasks/<%=taskId%>', + req: { + taskId: { + type: 'string' + } + } + } +}); + +/** + * Perform a [tasks.list](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.nodeId - 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 + * @param {String, String[], Boolean} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. + * @param {Boolean} params.detailed - Return detailed task information (default: false) + * @param {String} params.parentNode - Return tasks with specified parent node. + * @param {String} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + * @param {Boolean} params.waitForCompletion - Wait for the matching tasks to complete (default: false) + * @param {String} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships + */ +api.tasks.prototype.list = ca({ + params: { + nodeId: { + type: 'list', + name: 'node_id' + }, + actions: { + type: 'list' + }, + detailed: { + type: 'boolean' + }, + parentNode: { + type: 'string', + name: 'parent_node' + }, + parentTask: { + type: 'string', + name: 'parent_task' + }, + waitForCompletion: { + type: 'boolean', + name: 'wait_for_completion' + }, + groupBy: { + type: 'enum', + 'default': 'nodes', + options: [ + 'nodes', + 'parents' + ], + name: 'group_by' + } + }, + url: { + fmt: '/_tasks' + } +}); + +/** + * Perform a [termvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.termStatistics - Specifies if total term frequency and document frequency should be returned. + * @param {Boolean} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return. + * @param {Boolean} [params.offsets=true] - Specifies if term offsets should be returned. + * @param {Boolean} [params.positions=true] - Specifies if term positions should be returned. + * @param {Boolean} [params.payloads=true] - Specifies if term payloads should be returned. + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random). + * @param {String} params.routing - Specific routing value. + * @param {String} params.parent - Parent id of documents. + * @param {Boolean} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.index - The index in which the document resides. + * @param {String} params.type - The type of the document. + * @param {String} params.id - The id of the document, when not specified a doc param should be supplied. + */ +api.termvectors = ca({ + params: { + termStatistics: { + type: 'boolean', + 'default': false, + required: false, + name: 'term_statistics' + }, + fieldStatistics: { + type: 'boolean', + 'default': true, + required: false, + name: 'field_statistics' + }, + fields: { + type: 'list', + required: false + }, + offsets: { + type: 'boolean', + 'default': true, + required: false + }, + positions: { + type: 'boolean', + 'default': true, + required: false + }, + payloads: { + type: 'boolean', + 'default': true, + required: false + }, + preference: { + type: 'string', + required: false + }, + routing: { + type: 'string', + required: false + }, + parent: { + type: 'string', + required: false + }, + realtime: { + type: 'boolean', + required: false + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>/_termvectors', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [update](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {String} params.lang - The script language (default: groovy) + * @param {String} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request + * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {Number} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.update = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + fields: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + lang: { + type: 'string' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + retryOnConflict: { + type: 'number', + name: 'retry_on_conflict' + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + timestamp: { + type: 'time' + }, + ttl: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'force' + ], + name: 'version_type' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return as part of a hit + * @param {String, String[], Boolean} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit + * @param {Number} params.from - Starting offset (default: 0) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.conflicts=abort] - What to do when the reindex hits version conflicts? + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.searchType - Search operation type + * @param {Date, Number} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. + * @param {Number} params.size - Number of hits to return (default: 10) + * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes + * @param {String} params.suggestField - Specify which field to use for suggestions + * @param {String} [params.suggestMode=missing] - Specify suggest mode + * @param {Number} params.suggestSize - How many suggestions to return in response + * @param {String} params.suggestText - The source text for which the suggestions should be returned + * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. + * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting + * @param {Boolean} params.version - Specify whether to return document version as part of a hit + * @param {Boolean} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) + * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {Boolean} params.refresh - Should the effected indexes be refreshed? + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {Number} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {Boolean} params.waitForCompletion - Should the request should block until the reindex is complete. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.updateByQuery = ca({ + params: { + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + explain: { + type: 'boolean' + }, + storedFields: { + type: 'list', + name: 'stored_fields' + }, + docvalueFields: { + type: 'list', + name: 'docvalue_fields' + }, + fielddataFields: { + type: 'list', + name: 'fielddata_fields' + }, + from: { + type: 'number' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + conflicts: { + type: 'enum', + 'default': 'abort', + options: [ + 'abort', + 'proceed' + ] + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + pipeline: { + type: 'string' + }, + preference: { + type: 'string' + }, + q: { + type: 'string' + }, + routing: { + type: 'list' + }, + scroll: { + type: 'time' + }, + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'dfs_query_then_fetch' + ], + name: 'search_type' + }, + searchTimeout: { + type: 'time', + name: 'search_timeout' + }, + size: { + type: 'number' + }, + sort: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + terminateAfter: { + type: 'number', + name: 'terminate_after' + }, + stats: { + type: 'list' + }, + suggestField: { + type: 'string', + name: 'suggest_field' + }, + suggestMode: { + type: 'enum', + 'default': 'missing', + options: [ + 'missing', + 'popular', + 'always' + ], + name: 'suggest_mode' + }, + suggestSize: { + type: 'number', + name: 'suggest_size' + }, + suggestText: { + type: 'string', + name: 'suggest_text' + }, + timeout: { + type: 'time', + 'default': '1m' + }, + trackScores: { + type: 'boolean', + name: 'track_scores' + }, + version: { + type: 'boolean' + }, + versionType: { + type: 'boolean', + name: 'version_type' + }, + requestCache: { + type: 'boolean', + name: 'request_cache' + }, + refresh: { + type: 'boolean' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + scrollSize: { + type: 'number', + name: 'scroll_size' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + }, + requestsPerSecond: { + type: 'number', + 'default': 0, + name: 'requests_per_second' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_update_by_query', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_update_by_query', + req: { + index: { + type: 'list' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of the parent document + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.create = ca.proxy(api.index, { + transform: function (params) { + params.op_type = 'create'; + } +}); diff --git a/src/lib/apis/5_x.js b/src/lib/apis/5_x.js new file mode 100644 index 000000000..b758d4823 --- /dev/null +++ b/src/lib/apis/5_x.js @@ -0,0 +1,7160 @@ +var ca = require('../client_action').makeFactoryWithModifier(function (spec) { + return require('../utils').merge(spec, { + params: { + filterPath: { + type: 'list', + name: 'filter_path' + } + } + }); +}); +var namespace = require('../client_action').namespaceFactory; +var api = module.exports = {}; + +api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; + +/** + * Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.type - Default document type for items which don't provide one + * @param {String, String[], Boolean} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request + * @param {String, String[], Boolean} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request + * @param {String, String[], Boolean} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.index - Default index for items which don't provide one + */ +api.bulk = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + type: { + type: 'string' + }, + fields: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + pipeline: { + type: 'string' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_bulk', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_bulk', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_bulk' + } + ], + needBody: true, + bulkBody: true, + method: 'POST' +}); + +api.cat = namespace(); + +/** + * Perform a [cat.aliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return + */ +api.cat.prototype.aliases = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/aliases/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/_cat/aliases' + } + ] +}); + +/** + * Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.bytes - The unit in which to display byte values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information + */ +api.cat.prototype.allocation = ca({ + params: { + format: { + type: 'string' + }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/allocation/<%=nodeId%>', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_cat/allocation' + } + ] +}); + +/** + * Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.count = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/count/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/count' + } + ] +}); + +/** + * Perform a [cat.fielddata](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.bytes - The unit in which to display byte values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return the fielddata size + */ +api.cat.prototype.fielddata = ca({ + params: { + format: { + type: 'string' + }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + }, + fields: { + type: 'list' + } + }, + urls: [ + { + fmt: '/_cat/fielddata/<%=fields%>', + req: { + fields: { + type: 'list' + } + } + }, + { + fmt: '/_cat/fielddata' + } + ] +}); + +/** + * Perform a [cat.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} [params.ts=true] - Set to false to disable timestamping + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.health = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + ts: { + type: 'boolean', + 'default': true + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/health' + } +}); + +/** + * Perform a [cat.help](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + */ +api.cat.prototype.help = ca({ + params: { + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + } + }, + url: { + fmt: '/_cat' + } +}); + +/** + * Perform a [cat.indices](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.bytes - The unit in which to display byte values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {String} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.pri - Set to true to return stats only for primary shards + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.indices = ca({ + params: { + format: { + type: 'string' + }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'm', + 'g' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + health: { + type: 'enum', + 'default': null, + options: [ + 'green', + 'yellow', + 'red' + ] + }, + help: { + type: 'boolean', + 'default': false + }, + pri: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/indices/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/indices' + } + ] +}); + +/** + * Perform a [cat.master](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.master = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/master' + } +}); + +/** + * Perform a [cat.nodeattrs](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.nodeattrs = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/nodeattrs' + } +}); + +/** + * Perform a [cat.nodes](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.nodes = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/nodes' + } +}); + +/** + * Perform a [cat.pendingTasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.pendingTasks = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/pending_tasks' + } +}); + +/** + * Perform a [cat.plugins](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.plugins = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/plugins' + } +}); + +/** + * Perform a [cat.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.bytes - The unit in which to display byte values + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.recovery = ca({ + params: { + format: { + type: 'string' + }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/recovery/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/recovery' + } + ] +}); + +/** + * Perform a [cat.repositories](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.repositories = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean', + 'default': false + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/repositories' + } +}); + +/** + * Perform a [cat.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.segments = ca({ + params: { + format: { + type: 'string' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/segments/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/segments' + } + ] +}); + +/** + * Perform a [cat.shards](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.shards = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/shards/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/shards' + } + ] +}); + +/** + * Perform a [cat.snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.ignoreUnavailable - Set to true to ignore unavailable snapshots + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.repository - Name of repository from which to fetch the snapshot information + */ +api.cat.prototype.snapshots = ca({ + params: { + format: { + type: 'string' + }, + ignoreUnavailable: { + type: 'boolean', + 'default': false, + name: 'ignore_unavailable' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/snapshots/<%=repository%>', + req: { + repository: { + type: 'list' + } + } + }, + { + fmt: '/_cat/snapshots' + } + ] +}); + +/** + * Perform a [cat.tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String, String[], Boolean} params.nodeId - 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 + * @param {String, String[], Boolean} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. + * @param {Boolean} params.detailed - Return detailed task information (default: false) + * @param {String} params.parentNode - Return tasks with specified parent node. + * @param {Number} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.tasks = ca({ + params: { + format: { + type: 'string' + }, + nodeId: { + type: 'list', + name: 'node_id' + }, + actions: { + type: 'list' + }, + detailed: { + type: 'boolean' + }, + parentNode: { + type: 'string', + name: 'parent_node' + }, + parentTask: { + type: 'number', + name: 'parent_task' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/tasks' + } +}); + +/** + * Perform a [cat.templates](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String} params.name - A pattern that returned template names must match + */ +api.cat.prototype.templates = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/templates/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + { + fmt: '/_cat/templates' + } + ] +}); + +/** + * Perform a [cat.threadPool](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {String} params.size - The multiplier in which to display values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output + */ +api.cat.prototype.threadPool = ca({ + params: { + format: { + type: 'string' + }, + size: { + type: 'enum', + options: [ + '', + 'k', + 'm', + 'g', + 't', + 'p' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + }, + threadPoolPatterns: { + type: 'list', + name: 'thread_pool_patterns' + } + }, + urls: [ + { + fmt: '/_cat/thread_pool/<%=threadPools%>', + req: { + threadPools: {} + } + }, + { + fmt: '/_cat/thread_pool' + } + ] +}); + +/** + * Perform a [clearScroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.scrollId - A comma-separated list of scroll IDs to clear + */ +api.clearScroll = ca({ + urls: [ + { + fmt: '/_search/scroll/<%=scrollId%>', + req: { + scrollId: { + type: 'list' + } + } + }, + { + fmt: '/_search/scroll' + } + ], + method: 'DELETE' +}); + +api.cluster = namespace(); + +/** + * Perform a [cluster.allocationExplain](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) + * @param {Boolean} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) + */ +api.cluster.prototype.allocationExplain = ca({ + params: { + includeYesDecisions: { + type: 'boolean', + name: 'include_yes_decisions' + }, + includeDiskInfo: { + type: 'boolean', + name: 'include_disk_info' + } + }, + url: { + fmt: '/_cluster/allocation/explain' + }, + method: 'POST' +}); + +/** + * Perform a [cluster.getSettings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Boolean} params.includeDefaults - Whether to return all default clusters setting. + */ +api.cluster.prototype.getSettings = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + }, + includeDefaults: { + type: 'boolean', + 'default': false, + name: 'include_defaults' + } + }, + url: { + fmt: '/_cluster/settings' + } +}); + +/** + * Perform a [cluster.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} [params.level=cluster] - Specify the level of detail for returned information + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.waitForActiveShards - Wait until the specified number of shards is active + * @param {String} params.waitForNodes - Wait until the specified number of nodes is available + * @param {String} params.waitForEvents - Wait until all currently queued events with the given priorty are processed + * @param {Boolean} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster + * @param {String} params.waitForStatus - Wait until cluster is in a specific state + * @param {String, String[], Boolean} params.index - Limit the information returned to a specific index + */ +api.cluster.prototype.health = ca({ + params: { + level: { + type: 'enum', + 'default': 'cluster', + options: [ + 'cluster', + 'indices', + 'shards' + ] + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + waitForNodes: { + type: 'string', + name: 'wait_for_nodes' + }, + waitForEvents: { + type: 'enum', + options: [ + 'immediate', + 'urgent', + 'high', + 'normal', + 'low', + 'languid' + ], + name: 'wait_for_events' + }, + waitForNoRelocatingShards: { + type: 'boolean', + name: 'wait_for_no_relocating_shards' + }, + waitForStatus: { + type: 'enum', + 'default': null, + options: [ + 'green', + 'yellow', + 'red' + ], + name: 'wait_for_status' + } + }, + urls: [ + { + fmt: '/_cluster/health/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cluster/health' + } + ] +}); + +/** + * Perform a [cluster.pendingTasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + */ +api.cluster.prototype.pendingTasks = ca({ + params: { + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_cluster/pending_tasks' + } +}); + +/** + * Perform a [cluster.putSettings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + */ +api.cluster.prototype.putSettings = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_cluster/settings' + }, + method: 'PUT' +}); + +/** + * Perform a [cluster.reroute](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.dryRun - Simulate the operation only and return the resulting state + * @param {Boolean} params.explain - Return an explanation of why the commands can or cannot be executed + * @param {Boolean} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures + * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + */ +api.cluster.prototype.reroute = ca({ + params: { + dryRun: { + type: 'boolean', + name: 'dry_run' + }, + explain: { + type: 'boolean' + }, + retryFailed: { + type: 'boolean', + name: 'retry_failed' + }, + metric: { + type: 'list', + options: [ + '_all', + 'blocks', + 'metadata', + 'nodes', + 'routing_table', + 'master_node', + 'version' + ] + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_cluster/reroute' + }, + method: 'POST' +}); + +/** + * Perform a [cluster.state](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics + */ +api.cluster.prototype.state = ca({ + params: { + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/_cluster/state/<%=metric%>/<%=index%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'blocks', + 'metadata', + 'nodes', + 'routing_table', + 'routing_nodes', + 'master_node', + 'version' + ] + }, + index: { + type: 'list' + } + } + }, + { + fmt: '/_cluster/state/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'blocks', + 'metadata', + 'nodes', + 'routing_table', + 'routing_nodes', + 'master_node', + 'version' + ] + } + } + }, + { + fmt: '/_cluster/state' + } + ] +}); + +/** + * Perform a [cluster.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.nodeId - 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 + */ +api.cluster.prototype.stats = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + human: { + type: 'boolean', + 'default': false + }, + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_cluster/stats/nodes/<%=nodeId%>', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_cluster/stats' + } + ] +}); + +/** + * Perform a [count](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Number} params.minScore - Include only documents with a specific `_score` value in the result + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.routing - Specific routing value + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String, String[], Boolean} params.index - A comma-separated list of indices to restrict the results + * @param {String, String[], Boolean} params.type - A comma-separated list of types to restrict the results + */ +api.count = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + minScore: { + type: 'number', + name: 'min_score' + }, + preference: { + type: 'string' + }, + routing: { + type: 'string' + }, + q: { + type: 'string' + }, + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_count', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_count', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_count' + } + ], + method: 'POST' +}); + +/** + * Perform a [countPercolate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.percolateIndex - The index to count percolate the document into. Defaults to index. + * @param {String} params.percolateType - The type to count percolate document into. Defaults to type. + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.index - The index of the document being count percolated. + * @param {String} params.type - The type of the document being count percolated. + * @param {String} params.id - 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. + */ +api.countPercolate = ca({ + params: { + routing: { + type: 'list' + }, + preference: { + type: 'string' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + percolateIndex: { + type: 'string', + name: 'percolate_index' + }, + percolateType: { + type: 'string', + name: 'percolate_type' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>/_percolate/count', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of the parent document + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.create = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + timestamp: { + type: 'time' + }, + ttl: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + }, + pipeline: { + type: 'string' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'POST' +}); + +/** + * Perform a [delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of parent document + * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api['delete'] = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Number} params.from - Starting offset (default: 0) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.searchType - Search operation type + * @param {Date, Number} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. + * @param {Number} params.size - Number of hits to return (default: 10) + * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes + * @param {Boolean} params.version - Specify whether to return document version as part of a hit + * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {Boolean} params.refresh - Should the effected indexes be refreshed? + * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {Number} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {Boolean} params.waitForCompletion - Should the request should block until the delete-by-query is complete. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.deleteByQuery = ca({ + params: { + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + from: { + type: 'number' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + conflicts: { + type: 'enum', + 'default': 'abort', + options: [ + 'abort', + 'proceed' + ] + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + preference: { + type: 'string' + }, + q: { + type: 'string' + }, + routing: { + type: 'list' + }, + scroll: { + type: 'time' + }, + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'dfs_query_then_fetch' + ], + name: 'search_type' + }, + searchTimeout: { + type: 'time', + name: 'search_timeout' + }, + size: { + type: 'number' + }, + sort: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + terminateAfter: { + type: 'number', + name: 'terminate_after' + }, + stats: { + type: 'list' + }, + version: { + type: 'boolean' + }, + requestCache: { + type: 'boolean', + name: 'request_cache' + }, + refresh: { + type: 'boolean' + }, + timeout: { + type: 'time', + 'default': '1m' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + scrollSize: { + type: 'number', + name: 'scroll_size' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + }, + requestsPerSecond: { + type: 'number', + 'default': 0, + name: 'requests_per_second' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_delete_by_query', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_delete_by_query', + req: { + index: { + type: 'list' + } + } + } + ], + needBody: true, + method: 'POST' +}); + +/** + * Perform a [deleteScript](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Script ID + * @param {String} params.lang - Script language + */ +api.deleteScript = ca({ + url: { + fmt: '/_scripts/<%=lang%>/<%=id%>', + req: { + lang: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [deleteTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Template ID + */ +api.deleteTemplate = ca({ + url: { + fmt: '/_search/template/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.parent - The ID of the parent document + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode + * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation + * @param {String} params.routing - Specific routing value + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) + */ +api.exists = ca({ + params: { + parent: { + type: 'string' + }, + preference: { + type: 'string' + }, + realtime: { + type: 'boolean' + }, + refresh: { + type: 'boolean' + }, + routing: { + type: 'string' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'HEAD' +}); + +/** + * Perform a [explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) + * @param {String} params.analyzer - The analyzer for the query string query + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The default field for query string query (default: _all) + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String} params.parent - The ID of the parent document + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.explain = ca({ + params: { + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + analyzer: { + type: 'string' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + storedFields: { + type: 'list', + name: 'stored_fields' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + parent: { + type: 'string' + }, + preference: { + type: 'string' + }, + q: { + type: 'string' + }, + routing: { + type: 'string' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [fieldStats](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) + * @param {String} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.fieldStats = ca({ + params: { + fields: { + type: 'list' + }, + level: { + type: 'enum', + 'default': 'cluster', + options: [ + 'indices', + 'cluster' + ] + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/_field_stats', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_field_stats' + } + ], + method: 'POST' +}); + +/** + * Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response + * @param {String} params.parent - The ID of the parent document + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode + * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation + * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) + */ +api.get = ca({ + params: { + storedFields: { + type: 'list', + name: 'stored_fields' + }, + parent: { + type: 'string' + }, + preference: { + type: 'string' + }, + realtime: { + type: 'boolean' + }, + refresh: { + type: 'boolean' + }, + routing: { + type: 'string' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [getScript](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Script ID + * @param {String} params.lang - Script language + */ +api.getScript = ca({ + url: { + fmt: '/_scripts/<%=lang%>/<%=id%>', + req: { + lang: { + type: 'string' + }, + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [getSource](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.parent - The ID of the parent document + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode + * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation + * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.id - The document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types + */ +api.getSource = ca({ + params: { + parent: { + type: 'string' + }, + preference: { + type: 'string' + }, + realtime: { + type: 'boolean' + }, + refresh: { + type: 'boolean' + }, + routing: { + type: 'string' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [getTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Template ID + */ +api.getTemplate = ca({ + url: { + fmt: '/_search/template/<%=id%>', + req: { + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [index](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of the parent document + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.index = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + opType: { + type: 'enum', + 'default': 'index', + options: [ + 'index', + 'create' + ], + name: 'op_type' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + timestamp: { + type: 'time' + }, + ttl: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + }, + pipeline: { + type: 'string' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + } + ], + needBody: true, + method: 'POST' +}); + +api.indices = namespace(); + +/** + * Perform a [indices.analyze](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.analyzer - The name of the analyzer to use + * @param {String, String[], Boolean} params.charFilter - A comma-separated list of character filters to use for the analysis + * @param {String} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) + * @param {String, String[], Boolean} params.filter - A comma-separated list of filters to use for the analysis + * @param {String} params.index - The name of the index to scope the operation + * @param {Boolean} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) + * @param {String, String[], Boolean} params.text - The text on which the analysis should be performed (when request body is not used) + * @param {String} params.tokenizer - The name of the tokenizer to use for the analysis + * @param {Boolean} params.explain - With `true`, outputs more advanced details. (default: false) + * @param {String, String[], Boolean} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` + * @param {String} [params.format=detailed] - Format of the output + */ +api.indices.prototype.analyze = ca({ + params: { + analyzer: { + type: 'string' + }, + charFilter: { + type: 'list', + name: 'char_filter' + }, + field: { + type: 'string' + }, + filter: { + type: 'list' + }, + index: { + type: 'string' + }, + preferLocal: { + type: 'boolean', + name: 'prefer_local' + }, + text: { + type: 'list' + }, + tokenizer: { + type: 'string' + }, + explain: { + type: 'boolean' + }, + attributes: { + type: 'list' + }, + format: { + type: 'enum', + 'default': 'detailed', + options: [ + 'detailed', + 'text' + ] + } + }, + urls: [ + { + fmt: '/<%=index%>/_analyze', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_analyze' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.clearCache](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.fieldData - Clear field data + * @param {Boolean} params.fielddata - Clear field data + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) + * @param {Boolean} params.query - Clear query caches + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index name to limit the operation + * @param {Boolean} params.recycler - Clear the recycler cache + * @param {Boolean} params.request - Clear request cache + */ +api.indices.prototype.clearCache = ca({ + params: { + fieldData: { + type: 'boolean', + name: 'field_data' + }, + fielddata: { + type: 'boolean' + }, + fields: { + type: 'list' + }, + query: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + index: { + type: 'list' + }, + recycler: { + type: 'boolean' + }, + request: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_cache/clear', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cache/clear' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.close](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma separated list of indices to close + */ +api.indices.prototype.close = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + url: { + fmt: '/<%=index%>/_close', + req: { + index: { + type: 'list' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [indices.create](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not + * @param {String} params.index - The name of the index + */ +api.indices.prototype.create = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + updateAllTypes: { + type: 'boolean', + name: 'update_all_types' + } + }, + url: { + fmt: '/<%=index%>', + req: { + index: { + type: 'string' + } + } + }, + method: 'PUT' +}); + +/** + * Perform a [indices.delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String, String[], Boolean} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices + */ +api.indices.prototype['delete'] = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [indices.deleteAlias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit timestamp for the document + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String, String[], Boolean} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices + * @param {String, String[], Boolean} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. + */ +api.indices.prototype.deleteAlias = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/<%=index%>/_alias/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [indices.deleteTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String} params.name - The name of the template + */ +api.indices.prototype.deleteTemplate = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [indices.exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of indices to check + */ +api.indices.prototype.exists = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + url: { + fmt: '/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + method: 'HEAD' +}); + +/** + * Perform a [indices.existsAlias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases + * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return + */ +api.indices.prototype.existsAlias = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': [ + 'open', + 'closed' + ], + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_alias/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, + { + fmt: '/_alias/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_alias', + req: { + index: { + type: 'list' + } + } + } + ], + method: 'HEAD' +}); + +/** + * Perform a [indices.existsTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String} params.name - The name of the template + */ +api.indices.prototype.existsTemplate = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + local: { + type: 'boolean' + } + }, + url: { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + method: 'HEAD' +}); + +/** + * Perform a [indices.existsType](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` to check the types across all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to check + */ +api.indices.prototype.existsType = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + url: { + fmt: '/<%=index%>/_mapping/<%=type%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + method: 'HEAD' +}); + +/** + * Perform a [indices.flush](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.force - 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) + * @param {Boolean} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices + */ +api.indices.prototype.flush = ca({ + params: { + force: { + type: 'boolean' + }, + waitIfOngoing: { + type: 'boolean', + name: 'wait_if_ongoing' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/_flush', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_flush' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.flushSynced](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices + */ +api.indices.prototype.flushSynced = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/_flush/synced', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_flush/synced' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.forcemerge](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flush - Specify whether the index should be flushed after performing the operation (default: true) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Number} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) + * @param {Boolean} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents + * @param {Anything} params.operationThreading - TODO: ? + * @param {Boolean} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.forcemerge = ca({ + params: { + flush: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + maxNumSegments: { + type: 'number', + name: 'max_num_segments' + }, + onlyExpungeDeletes: { + type: 'boolean', + name: 'only_expunge_deletes' + }, + operationThreading: { + name: 'operation_threading' + }, + waitForMerge: { + type: 'boolean', + name: 'wait_for_merge' + } + }, + urls: [ + { + fmt: '/<%=index%>/_forcemerge', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_forcemerge' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Boolean} params.ignoreUnavailable - Ignore unavailable indexes (default: false) + * @param {Boolean} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) + * @param {String} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.human - Whether to return version and creation date values in human-readable format. + * @param {Boolean} params.includeDefaults - Whether to return all default setting for each of the indices. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names + * @param {String, String[], Boolean} params.feature - A comma-separated list of features + */ +api.indices.prototype.get = ca({ + params: { + local: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + human: { + type: 'boolean', + 'default': false + }, + includeDefaults: { + type: 'boolean', + 'default': false, + name: 'include_defaults' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=feature%>', + req: { + index: { + type: 'list' + }, + feature: { + type: 'list', + options: [ + '_settings', + '_mappings', + '_aliases' + ] + } + } + }, + { + fmt: '/<%=index%>', + req: { + index: { + type: 'list' + } + } + } + ] +}); + +/** + * Perform a [indices.getAlias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases + * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return + */ +api.indices.prototype.getAlias = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'all', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_alias/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, + { + fmt: '/_alias/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_alias', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_alias' + } + ] +}); + +/** + * Perform a [indices.getFieldMapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.includeDefaults - Whether the default mapping values should be returned as well + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names + * @param {String, String[], Boolean} params.type - A comma-separated list of document types + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields + */ +api.indices.prototype.getFieldMapping = ca({ + params: { + includeDefaults: { + type: 'boolean', + name: 'include_defaults' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + }, + fields: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_mapping/field/<%=fields%>', + req: { + index: { + type: 'list' + }, + fields: { + type: 'list' + } + } + }, + { + fmt: '/_mapping/<%=type%>/field/<%=fields%>', + req: { + type: { + type: 'list' + }, + fields: { + type: 'list' + } + } + }, + { + fmt: '/_mapping/field/<%=fields%>', + req: { + fields: { + type: 'list' + } + } + } + ] +}); + +/** + * Perform a [indices.getMapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names + * @param {String, String[], Boolean} params.type - A comma-separated list of document types + */ +api.indices.prototype.getMapping = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/_mapping/<%=type%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_mapping', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_mapping/<%=type%>', + req: { + type: { + type: 'list' + } + } + }, + { + fmt: '/_mapping' + } + ] +}); + +/** + * Perform a [indices.getSettings](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Boolean} params.human - Whether to return version and creation date values in human-readable format. + * @param {Boolean} params.includeDefaults - Whether to return all default setting for each of the indices. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.name - The name of the settings that should be included + */ +api.indices.prototype.getSettings = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': [ + 'open', + 'closed' + ], + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + local: { + type: 'boolean' + }, + human: { + type: 'boolean', + 'default': false + }, + includeDefaults: { + type: 'boolean', + 'default': false, + name: 'include_defaults' + } + }, + urls: [ + { + fmt: '/<%=index%>/_settings/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_settings', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_settings/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/_settings' + } + ] +}); + +/** + * Perform a [indices.getTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.name - The comma separated names of the index templates + */ +api.indices.prototype.getTemplate = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/_template' + } + ] +}); + +/** + * Perform a [indices.getUpgrade](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.getUpgrade = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_upgrade', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_upgrade' + } + ] +}); + +/** + * Perform a [indices.open](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma separated list of indices to open + */ +api.indices.prototype.open = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'closed', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + url: { + fmt: '/<%=index%>/_open', + req: { + index: { + type: 'list' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [indices.putAlias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit timestamp for the document + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String, String[], Boolean} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. + * @param {String} params.name - The name of the alias to be created or updated + */ +api.indices.prototype.putAlias = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/<%=index%>/_alias/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'string' + } + } + }, + method: 'PUT' +}); + +/** + * Perform a [indices.putMapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not + * @param {String, String[], Boolean} params.index - 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. + * @param {String} params.type - The name of the document type + */ +api.indices.prototype.putMapping = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + updateAllTypes: { + type: 'boolean', + name: 'update_all_types' + } + }, + urls: [ + { + fmt: '/<%=index%>/_mapping/<%=type%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/_mapping/<%=type%>', + req: { + type: { + type: 'string' + } + } + } + ], + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [indices.putSettings](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.putSettings = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + preserveExisting: { + type: 'boolean', + name: 'preserve_existing' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + } + }, + urls: [ + { + fmt: '/<%=index%>/_settings', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_settings' + } + ], + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [indices.putTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Number} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) + * @param {Boolean} params.create - Whether the index template should only be added if new or can also replace an existing one + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {String} params.name - The name of the template + */ +api.indices.prototype.putTemplate = ca({ + params: { + order: { + type: 'number' + }, + create: { + type: 'boolean', + 'default': false + }, + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + } + }, + url: { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [indices.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.detailed - Whether to display detailed information about shard recovery + * @param {Boolean} params.activeOnly - Display only those recoveries that are currently on-going + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.recovery = ca({ + params: { + detailed: { + type: 'boolean', + 'default': false + }, + activeOnly: { + type: 'boolean', + 'default': false, + name: 'active_only' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_recovery', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_recovery' + } + ] +}); + +/** + * Perform a [indices.refresh](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.force - Force a refresh even if not required + * @param {Anything} params.operationThreading - TODO: ? + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.refresh = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + force: { + type: 'boolean', + 'default': false + }, + operationThreading: { + name: 'operation_threading' + } + }, + urls: [ + { + fmt: '/<%=index%>/_refresh', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_refresh' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.rollover](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. + * @param {String} params.alias - The name of the alias to rollover + * @param {String} params.newIndex - The name of the rollover index + */ +api.indices.prototype.rollover = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + } + }, + urls: [ + { + fmt: '/<%=alias%>/_rollover/<%=newIndex%>', + req: { + alias: { + type: 'string' + }, + newIndex: { + type: 'string' + } + } + }, + { + fmt: '/<%=alias%>/_rollover', + req: { + alias: { + type: 'string' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {Anything} params.operationThreading - TODO: ? + * @param {Boolean} params.verbose - Includes detailed memory usage by Lucene. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.segments = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + human: { + type: 'boolean', + 'default': false + }, + operationThreading: { + name: 'operation_threading' + }, + verbose: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_segments', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_segments' + } + ] +}); + +/** + * Perform a [indices.shardStores](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.status - A comma-separated list of statuses used to filter on shards to get store information for + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Anything} params.operationThreading - TODO: ? + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.shardStores = ca({ + params: { + status: { + type: 'list', + options: [ + 'green', + 'yellow', + 'red', + 'all' + ] + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + operationThreading: { + name: 'operation_threading' + } + }, + urls: [ + { + fmt: '/<%=index%>/_shard_stores', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_shard_stores' + } + ] +}); + +/** + * Perform a [indices.shrink](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {String} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. + * @param {String} params.index - The name of the source index to shrink + * @param {String} params.target - The name of the target index to shrink into + */ +api.indices.prototype.shrink = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + } + }, + url: { + fmt: '/<%=index%>/_shrink/<%=target%>', + req: { + index: { + type: 'string' + }, + target: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [indices.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * @param {String, String[], Boolean} params.groups - A comma-separated list of search groups for `search` index metric + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String} [params.level=indices] - Return stats aggregated at cluster, index or shard level + * @param {String, String[], Boolean} params.types - A comma-separated list of document types for the `indexing` index metric + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.metric - Limit the information returned the specific metrics. + */ +api.indices.prototype.stats = ca({ + params: { + completionFields: { + type: 'list', + name: 'completion_fields' + }, + fielddataFields: { + type: 'list', + name: 'fielddata_fields' + }, + fields: { + type: 'list' + }, + groups: { + type: 'list' + }, + human: { + type: 'boolean', + 'default': false + }, + level: { + type: 'enum', + 'default': 'indices', + options: [ + 'cluster', + 'indices', + 'shards' + ] + }, + types: { + type: 'list' + } + }, + urls: [ + { + fmt: '/<%=index%>/_stats/<%=metric%>', + req: { + index: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'query_cache', + 'flush', + 'get', + 'indexing', + 'merge', + 'percolate', + 'request_cache', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer', + 'suggest' + ] + } + } + }, + { + fmt: '/_stats/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'query_cache', + 'flush', + 'get', + 'indexing', + 'merge', + 'percolate', + 'request_cache', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer', + 'suggest' + ] + } + } + }, + { + fmt: '/<%=index%>/_stats', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_stats' + } + ] +}); + +/** + * Perform a [indices.updateAliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.timeout - Request timeout + * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + */ +api.indices.prototype.updateAliases = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_aliases' + }, + needBody: true, + method: 'POST' +}); + +/** + * Perform a [indices.upgrade](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) + * @param {Boolean} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.upgrade = ca({ + params: { + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + waitForCompletion: { + type: 'boolean', + name: 'wait_for_completion' + }, + onlyAncientSegments: { + type: 'boolean', + name: 'only_ancient_segments' + } + }, + urls: [ + { + fmt: '/<%=index%>/_upgrade', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_upgrade' + } + ], + method: 'POST' +}); + +/** + * Perform a [indices.validateQuery](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.explain - Return detailed information about the error + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Anything} params.operationThreading - TODO: ? + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {Boolean} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types + */ +api.indices.prototype.validateQuery = ca({ + params: { + explain: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + operationThreading: { + name: 'operation_threading' + }, + q: { + type: 'string' + }, + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + rewrite: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_validate/query', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_validate/query', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_validate/query' + } + ], + method: 'POST' +}); + +/** + * Perform a [info](http://www.elastic.co/guide/) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.info = ca({ + url: { + fmt: '/' + } +}); + +api.ingest = namespace(); + +/** + * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.id - Pipeline ID + */ +api.ingest.prototype.deletePipeline = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_ingest/pipeline/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String} params.id - Comma separated list of pipeline ids. Wildcards supported + */ +api.ingest.prototype.getPipeline = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + urls: [ + { + fmt: '/_ingest/pipeline/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + { + fmt: '/_ingest/pipeline' + } + ] +}); + +/** + * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.id - Pipeline ID + */ +api.ingest.prototype.putPipeline = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_ingest/pipeline/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.verbose - Verbose mode. Display data output for each processor in executed pipeline + * @param {String} params.id - Pipeline ID + */ +api.ingest.prototype.simulate = ca({ + params: { + verbose: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_ingest/pipeline/<%=id%>/_simulate', + req: { + id: { + type: 'string' + } + } + }, + { + fmt: '/_ingest/pipeline/_simulate' + } + ], + needBody: true, + method: 'POST' +}); + +/** + * Perform a [mget](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode + * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.mget = ca({ + params: { + storedFields: { + type: 'list', + name: 'stored_fields' + }, + preference: { + type: 'string' + }, + realtime: { + type: 'boolean' + }, + refresh: { + type: 'boolean' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_mget', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_mget', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_mget' + } + ], + needBody: true, + method: 'POST' +}); + +/** + * Perform a [mpercolate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.index - The index of the document being count percolated to use as default + * @param {String} params.type - The type of the document being percolated to use as default. + */ +api.mpercolate = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_mpercolate', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_mpercolate', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_mpercolate' + } + ], + needBody: true, + bulkBody: true, + method: 'POST' +}); + +/** + * Perform a [msearch](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.searchType - Search operation type + * @param {Number} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to use as default + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to use as default + */ +api.msearch = ca({ + params: { + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'query_and_fetch', + 'dfs_query_then_fetch', + 'dfs_query_and_fetch' + ], + name: 'search_type' + }, + maxConcurrentSearches: { + type: 'number', + name: 'max_concurrent_searches' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_msearch', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_msearch', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_msearch' + } + ], + needBody: true, + bulkBody: true, + method: 'POST' +}); + +/** + * Perform a [msearchTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.searchType - Search operation type + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to use as default + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to use as default + */ +api.msearchTemplate = ca({ + params: { + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'query_and_fetch', + 'dfs_query_then_fetch', + 'dfs_query_and_fetch' + ], + name: 'search_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_msearch/template', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_msearch/template', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_msearch/template' + } + ], + needBody: true, + bulkBody: true, + method: 'POST' +}); + +/** + * Perform a [mtermvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body + * @param {Boolean} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} [params.fieldStatistics=true] - 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". + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {String} params.preference - 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". + * @param {String} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {String} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". + * @param {Boolean} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.index - The index in which the document resides. + * @param {String} params.type - The type of the document. + */ +api.mtermvectors = ca({ + params: { + ids: { + type: 'list', + required: false + }, + termStatistics: { + type: 'boolean', + 'default': false, + required: false, + name: 'term_statistics' + }, + fieldStatistics: { + type: 'boolean', + 'default': true, + required: false, + name: 'field_statistics' + }, + fields: { + type: 'list', + required: false + }, + offsets: { + type: 'boolean', + 'default': true, + required: false + }, + positions: { + type: 'boolean', + 'default': true, + required: false + }, + payloads: { + type: 'boolean', + 'default': true, + required: false + }, + preference: { + type: 'string', + required: false + }, + routing: { + type: 'string', + required: false + }, + parent: { + type: 'string', + required: false + }, + realtime: { + type: 'boolean', + required: false + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_mtermvectors', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_mtermvectors', + req: { + index: { + type: 'string' + } + } + }, + { + fmt: '/_mtermvectors' + } + ], + method: 'POST' +}); + +api.nodes = namespace(); + +/** + * Perform a [nodes.hotThreads](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.interval - The interval for the second sampling of threads + * @param {Number} params.snapshots - Number of samples of thread stacktrace (default: 10) + * @param {Number} params.threads - Specify the number of threads to provide information for (default: 3) + * @param {Boolean} params.ignoreIdleThreads - 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) + * @param {String} params.type - The type to sample (default: cpu) + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.nodeId - 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 + */ +api.nodes.prototype.hotThreads = ca({ + params: { + interval: { + type: 'time' + }, + snapshots: { + type: 'number' + }, + threads: { + type: 'number' + }, + ignoreIdleThreads: { + type: 'boolean', + name: 'ignore_idle_threads' + }, + type: { + type: 'enum', + options: [ + 'cpu', + 'wait', + 'block' + ] + }, + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/hotthreads', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/hotthreads' + } + ] +}); + +/** + * Perform a [nodes.info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.nodeId - 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 + * @param {String, String[], Boolean} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. + */ +api.nodes.prototype.info = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + human: { + type: 'boolean', + 'default': false + }, + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/<%=metric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + 'settings', + 'os', + 'process', + 'jvm', + 'thread_pool', + 'transport', + 'http', + 'plugins', + 'ingest' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + 'settings', + 'os', + 'process', + 'jvm', + 'thread_pool', + 'transport', + 'http', + 'plugins', + 'ingest' + ] + } + } + }, + { + fmt: '/_nodes' + } + ] +}); + +/** + * Perform a [nodes.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * @param {Boolean} params.groups - A comma-separated list of search groups for `search` index metric + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String} [params.level=node] - Return indices stats aggregated at index, node or shard level + * @param {String, String[], Boolean} params.types - A comma-separated list of document types for the `indexing` index metric + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics + * @param {String, String[], Boolean} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. + * @param {String, String[], Boolean} params.nodeId - 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 + */ +api.nodes.prototype.stats = ca({ + params: { + completionFields: { + type: 'list', + name: 'completion_fields' + }, + fielddataFields: { + type: 'list', + name: 'fielddata_fields' + }, + fields: { + type: 'list' + }, + groups: { + type: 'boolean' + }, + human: { + type: 'boolean', + 'default': false + }, + level: { + type: 'enum', + 'default': 'node', + options: [ + 'indices', + 'node', + 'shards' + ] + }, + types: { + type: 'list' + }, + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'os', + 'process', + 'thread_pool', + 'transport', + 'discovery' + ] + }, + indexMetric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'query_cache', + 'flush', + 'get', + 'indexing', + 'merge', + 'percolate', + 'request_cache', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer', + 'suggest' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'os', + 'process', + 'thread_pool', + 'transport', + 'discovery' + ] + } + } + }, + { + fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'os', + 'process', + 'thread_pool', + 'transport', + 'discovery' + ] + }, + indexMetric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'query_cache', + 'flush', + 'get', + 'indexing', + 'merge', + 'percolate', + 'request_cache', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer', + 'suggest' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>/stats', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/stats/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'os', + 'process', + 'thread_pool', + 'transport', + 'discovery' + ] + } + } + }, + { + fmt: '/_nodes/stats' + } + ] +}); + +/** + * Perform a [percolate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-percolate.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.percolateIndex - The index to percolate the document into. Defaults to index. + * @param {String} params.percolateType - The type to percolate document into. Defaults to type. + * @param {String} params.percolateRouting - The routing value to use when percolating the existing document. + * @param {String} params.percolatePreference - Which shard to prefer when executing the percolate request. + * @param {String} params.percolateFormat - Return an array of matching query IDs instead of objects + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.index - The index of the document being percolated. + * @param {String} params.type - The type of the document being percolated. + * @param {String} params.id - 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. + */ +api.percolate = ca({ + params: { + routing: { + type: 'list' + }, + preference: { + type: 'string' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + percolateIndex: { + type: 'string', + name: 'percolate_index' + }, + percolateType: { + type: 'string', + name: 'percolate_type' + }, + percolateRouting: { + type: 'string', + name: 'percolate_routing' + }, + percolatePreference: { + type: 'string', + name: 'percolate_preference' + }, + percolateFormat: { + type: 'enum', + options: [ + 'ids' + ], + name: 'percolate_format' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>/_percolate', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [ping](http://www.elastic.co/guide/) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.ping = ca({ + url: { + fmt: '/' + }, + requestTimeout: 3000, + method: 'HEAD' +}); + +/** + * Perform a [putScript](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Script ID + * @param {String} params.lang - Script language + */ +api.putScript = ca({ + url: { + fmt: '/_scripts/<%=lang%>/<%=id%>', + req: { + lang: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [putTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - Template ID + */ +api.putTemplate = ca({ + url: { + fmt: '/_search/template/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.refresh - Should the effected indexes be refreshed? + * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {Boolean} params.waitForCompletion - Should the request should block until the reindex is complete. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. + */ +api.reindex = ca({ + params: { + refresh: { + type: 'boolean' + }, + timeout: { + type: 'time', + 'default': '1m' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + }, + requestsPerSecond: { + type: 'number', + 'default': 0, + name: 'requests_per_second' + } + }, + url: { + fmt: '/_reindex' + }, + needBody: true, + method: 'POST' +}); + +/** + * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Number} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * @param {String} params.taskId - The task id to rethrottle + */ +api.reindexRethrottle = ca({ + params: { + requestsPerSecond: { + type: 'number', + required: true, + name: 'requests_per_second' + } + }, + url: { + fmt: '/_reindex/<%=taskId%>/_rethrottle', + req: { + taskId: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [renderSearchTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.id - The id of the stored search template + */ +api.renderSearchTemplate = ca({ + urls: [ + { + fmt: '/_render/template/<%=id%>', + req: { + id: { + type: 'string' + } + } + }, + { + fmt: '/_render/template' + } + ], + method: 'POST' +}); + +/** + * Perform a [scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.scrollId - The scroll ID + */ +api.scroll = ca({ + params: { + scroll: { + type: 'time' + }, + scrollId: { + type: 'string', + name: 'scroll_id' + } + }, + urls: [ + { + fmt: '/_search/scroll/<%=scrollId%>', + req: { + scrollId: { + type: 'string' + } + } + }, + { + fmt: '/_search/scroll' + } + ], + paramAsBody: 'scrollId', + method: 'POST' +}); + +/** + * Perform a [search](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return as part of a hit + * @param {String, String[], Boolean} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit + * @param {Number} params.from - Starting offset (default: 0) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.searchType - Search operation type + * @param {Number} params.size - Number of hits to return (default: 10) + * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes + * @param {String} params.suggestField - Specify which field to use for suggestions + * @param {String} [params.suggestMode=missing] - Specify suggest mode + * @param {Number} params.suggestSize - How many suggestions to return in response + * @param {String} params.suggestText - The source text for which the suggestions should be returned + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting + * @param {Boolean} params.version - Specify whether to return document version as part of a hit + * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.search = ca({ + params: { + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + explain: { + type: 'boolean' + }, + storedFields: { + type: 'list', + name: 'stored_fields' + }, + docvalueFields: { + type: 'list', + name: 'docvalue_fields' + }, + fielddataFields: { + type: 'list', + name: 'fielddata_fields' + }, + from: { + type: 'number' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + preference: { + type: 'string' + }, + q: { + type: 'string' + }, + routing: { + type: 'list' + }, + scroll: { + type: 'time' + }, + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'dfs_query_then_fetch' + ], + name: 'search_type' + }, + size: { + type: 'number' + }, + sort: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + terminateAfter: { + type: 'number', + name: 'terminate_after' + }, + stats: { + type: 'list' + }, + suggestField: { + type: 'string', + name: 'suggest_field' + }, + suggestMode: { + type: 'enum', + 'default': 'missing', + options: [ + 'missing', + 'popular', + 'always' + ], + name: 'suggest_mode' + }, + suggestSize: { + type: 'number', + name: 'suggest_size' + }, + suggestText: { + type: 'string', + name: 'suggest_text' + }, + timeout: { + type: 'time' + }, + trackScores: { + type: 'boolean', + name: 'track_scores' + }, + version: { + type: 'boolean' + }, + requestCache: { + type: 'boolean', + name: 'request_cache' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_search', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_search', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_search' + } + ], + method: 'POST' +}); + +/** + * Perform a [searchShards](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.routing - Specific routing value + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.searchShards = ca({ + params: { + preference: { + type: 'string' + }, + routing: { + type: 'string' + }, + local: { + type: 'boolean' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_search_shards', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_search_shards', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_search_shards' + } + ], + method: 'POST' +}); + +/** + * Perform a [searchTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.searchType - Search operation type + * @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit + * @param {Boolean} params.profile - Specify whether to profile the query execution + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.searchTemplate = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + preference: { + type: 'string' + }, + routing: { + type: 'list' + }, + scroll: { + type: 'time' + }, + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'query_and_fetch', + 'dfs_query_then_fetch', + 'dfs_query_and_fetch' + ], + name: 'search_type' + }, + explain: { + type: 'boolean' + }, + profile: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_search/template', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_search/template', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_search/template' + } + ], + method: 'POST' +}); + +api.snapshot = namespace(); + +/** + * Perform a [snapshot.create](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.waitForCompletion - Should this request wait until the operation has completed before returning + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.snapshot.prototype.create = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [snapshot.createRepository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Boolean} params.verify - Whether to verify the repository after creation + * @param {String} params.repository - A repository name + */ +api.snapshot.prototype.createRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + }, + verify: { + type: 'boolean' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'string' + } + } + }, + needBody: true, + method: 'POST' +}); + +/** + * Perform a [snapshot.delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.snapshot.prototype['delete'] = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'string' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [snapshot.deleteRepository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.repository - A comma-separated list of repository names + */ +api.snapshot.prototype.deleteRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'list' + } + } + }, + method: 'DELETE' +}); + +/** + * Perform a [snapshot.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * @param {String} params.repository - A repository name + * @param {String, String[], Boolean} params.snapshot - A comma-separated list of snapshot names + */ +api.snapshot.prototype.get = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'list' + } + } + } +}); + +/** + * Perform a [snapshot.getRepository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {String, String[], Boolean} params.repository - A comma-separated list of repository names + */ +api.snapshot.prototype.getRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + local: { + type: 'boolean' + } + }, + urls: [ + { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'list' + } + } + }, + { + fmt: '/_snapshot' + } + ] +}); + +/** + * Perform a [snapshot.restore](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.waitForCompletion - Should this request wait until the operation has completed before returning + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.snapshot.prototype.restore = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [snapshot.status](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * @param {String} params.repository - A repository name + * @param {String, String[], Boolean} params.snapshot - A comma-separated list of snapshot names + */ +api.snapshot.prototype.status = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + } + }, + urls: [ + { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'list' + } + } + }, + { + fmt: '/_snapshot/<%=repository%>/_status', + req: { + repository: { + type: 'string' + } + } + }, + { + fmt: '/_snapshot/_status' + } + ] +}); + +/** + * Perform a [snapshot.verifyRepository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.repository - A repository name + */ +api.snapshot.prototype.verifyRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/_verify', + req: { + repository: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [suggest](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-suggesters.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + */ +api.suggest = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + preference: { + type: 'string' + }, + routing: { + type: 'string' + } + }, + urls: [ + { + fmt: '/<%=index%>/_suggest', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_suggest' + } + ], + needBody: true, + method: 'POST' +}); + +api.tasks = namespace(); + +/** + * Perform a [tasks.cancel](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.nodeId - 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 + * @param {String, String[], Boolean} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. + * @param {String} params.parentNode - Cancel tasks with specified parent node. + * @param {String} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. + * @param {String} params.taskId - Cancel the task with specified task id (node_id:task_number) + */ +api.tasks.prototype.cancel = ca({ + params: { + nodeId: { + type: 'list', + name: 'node_id' + }, + actions: { + type: 'list' + }, + parentNode: { + type: 'string', + name: 'parent_node' + }, + parentTask: { + type: 'string', + name: 'parent_task' + } + }, + urls: [ + { + fmt: '/_tasks/<%=taskId%>/_cancel', + req: { + taskId: { + type: 'string' + } + } + }, + { + fmt: '/_tasks/_cancel' + } + ], + method: 'POST' +}); + +/** + * Perform a [tasks.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.waitForCompletion - Wait for the matching tasks to complete (default: false) + * @param {String} params.taskId - Return the task with specified id (node_id:task_number) + */ +api.tasks.prototype.get = ca({ + params: { + waitForCompletion: { + type: 'boolean', + name: 'wait_for_completion' + } + }, + url: { + fmt: '/_tasks/<%=taskId%>', + req: { + taskId: { + type: 'string' + } + } + } +}); + +/** + * Perform a [tasks.list](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String, String[], Boolean} params.nodeId - 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 + * @param {String, String[], Boolean} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. + * @param {Boolean} params.detailed - Return detailed task information (default: false) + * @param {String} params.parentNode - Return tasks with specified parent node. + * @param {String} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + * @param {Boolean} params.waitForCompletion - Wait for the matching tasks to complete (default: false) + * @param {String} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships + */ +api.tasks.prototype.list = ca({ + params: { + nodeId: { + type: 'list', + name: 'node_id' + }, + actions: { + type: 'list' + }, + detailed: { + type: 'boolean' + }, + parentNode: { + type: 'string', + name: 'parent_node' + }, + parentTask: { + type: 'string', + name: 'parent_task' + }, + waitForCompletion: { + type: 'boolean', + name: 'wait_for_completion' + }, + groupBy: { + type: 'enum', + 'default': 'nodes', + options: [ + 'nodes', + 'parents' + ], + name: 'group_by' + } + }, + url: { + fmt: '/_tasks' + } +}); + +/** + * Perform a [termvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.termStatistics - Specifies if total term frequency and document frequency should be returned. + * @param {Boolean} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return. + * @param {Boolean} [params.offsets=true] - Specifies if term offsets should be returned. + * @param {Boolean} [params.positions=true] - Specifies if term positions should be returned. + * @param {Boolean} [params.payloads=true] - Specifies if term payloads should be returned. + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random). + * @param {String} params.routing - Specific routing value. + * @param {String} params.parent - Parent id of documents. + * @param {Boolean} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.index - The index in which the document resides. + * @param {String} params.type - The type of the document. + * @param {String} params.id - The id of the document, when not specified a doc param should be supplied. + */ +api.termvectors = ca({ + params: { + termStatistics: { + type: 'boolean', + 'default': false, + required: false, + name: 'term_statistics' + }, + fieldStatistics: { + type: 'boolean', + 'default': true, + required: false, + name: 'field_statistics' + }, + fields: { + type: 'list', + required: false + }, + offsets: { + type: 'boolean', + 'default': true, + required: false + }, + positions: { + type: 'boolean', + 'default': true, + required: false + }, + payloads: { + type: 'boolean', + 'default': true, + required: false + }, + preference: { + type: 'string', + required: false + }, + routing: { + type: 'string', + required: false + }, + parent: { + type: 'string', + required: false + }, + realtime: { + type: 'boolean', + required: false + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>/_termvectors', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [update](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {String} params.lang - The script language (default: groovy) + * @param {String} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request + * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {Number} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.update = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + fields: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + lang: { + type: 'string' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + retryOnConflict: { + type: 'number', + name: 'retry_on_conflict' + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + timestamp: { + type: 'time' + }, + ttl: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'force' + ], + name: 'version_type' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.analyzer - The analyzer to use for the query string + * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) + * @param {String} params.df - The field to use as default where no field prefix is given in the query string + * @param {Number} params.from - Starting offset (default: 0) + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.conflicts=abort] - What to do when the update by query hits version conflicts? + * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased + * @param {String} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) + * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) + * @param {String} params.q - Query in the Lucene query string syntax + * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {String} params.searchType - Search operation type + * @param {Date, Number} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. + * @param {Number} params.size - Number of hits to return (default: 10) + * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes + * @param {Boolean} params.version - Specify whether to return document version as part of a hit + * @param {Boolean} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) + * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {Boolean} params.refresh - Should the effected indexes be refreshed? + * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {Number} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {Boolean} params.waitForCompletion - Should the request should block until the update by query operation is complete. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.updateByQuery = ca({ + params: { + analyzer: { + type: 'string' + }, + analyzeWildcard: { + type: 'boolean', + name: 'analyze_wildcard' + }, + defaultOperator: { + type: 'enum', + 'default': 'OR', + options: [ + 'AND', + 'OR' + ], + name: 'default_operator' + }, + df: { + type: 'string' + }, + from: { + type: 'number' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + conflicts: { + type: 'enum', + 'default': 'abort', + options: [ + 'abort', + 'proceed' + ] + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed', + 'none', + 'all' + ], + name: 'expand_wildcards' + }, + lenient: { + type: 'boolean' + }, + lowercaseExpandedTerms: { + type: 'boolean', + name: 'lowercase_expanded_terms' + }, + pipeline: { + type: 'string' + }, + preference: { + type: 'string' + }, + q: { + type: 'string' + }, + routing: { + type: 'list' + }, + scroll: { + type: 'time' + }, + searchType: { + type: 'enum', + options: [ + 'query_then_fetch', + 'dfs_query_then_fetch' + ], + name: 'search_type' + }, + searchTimeout: { + type: 'time', + name: 'search_timeout' + }, + size: { + type: 'number' + }, + sort: { + type: 'list' + }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, + terminateAfter: { + type: 'number', + name: 'terminate_after' + }, + stats: { + type: 'list' + }, + version: { + type: 'boolean' + }, + versionType: { + type: 'boolean', + name: 'version_type' + }, + requestCache: { + type: 'boolean', + name: 'request_cache' + }, + refresh: { + type: 'boolean' + }, + timeout: { + type: 'time', + 'default': '1m' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + scrollSize: { + type: 'number', + name: 'scroll_size' + }, + waitForCompletion: { + type: 'boolean', + 'default': false, + name: 'wait_for_completion' + }, + requestsPerSecond: { + type: 'number', + 'default': 0, + name: 'requests_per_second' + } + }, + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_update_by_query', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_update_by_query', + req: { + index: { + type: 'list' + } + } + } + ], + method: 'POST' +}); + +/** + * Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of the parent document + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.create = ca.proxy(api.index, { + transform: function (params) { + params.op_type = 'create'; + } +}); diff --git a/src/lib/apis/browser_index.js b/src/lib/apis/browser_index.js index d2236f456..a6d60b62d 100644 --- a/src/lib/apis/browser_index.js +++ b/src/lib/apis/browser_index.js @@ -1,10 +1,10 @@ module.exports = { - '_default': require('./2_3'), + '_default': require('./5_0'), + '5.0': require('./5_0'), + '2.4': require('./2_4'), '2.3': require('./2_3'), '2.2': require('./2_2'), '2.1': require('./2_1'), - '2.0': require('./2_0'), - '1.7': require('./1_7'), - '2.4': require('./2_4'), + '5.x': require('./5_x'), 'master': require('./master') }; diff --git a/src/lib/apis/index.js b/src/lib/apis/index.js index a35870938..96b2b74aa 100644 --- a/src/lib/apis/index.js +++ b/src/lib/apis/index.js @@ -1,5 +1,7 @@ module.exports = { - '_default': require('./2_3'), + '_default': require('./5_0'), + '5.0': require('./5_0'), + '2.4': require('./2_4'), '2.3': require('./2_3'), '2.2': require('./2_2'), '2.1': require('./2_1'), @@ -13,6 +15,6 @@ module.exports = { '1.1': require('./1_1'), '1.0': require('./1_0'), '0.90': require('./0_90'), - '2.4': require('./2_4'), + '5.x': require('./5_x'), 'master': require('./master') }; diff --git a/src/lib/apis/master.js b/src/lib/apis/master.js index 84a850956..d5ec6d8df 100644 --- a/src/lib/apis/master.js +++ b/src/lib/apis/master.js @@ -11,7 +11,7 @@ var ca = require('../client_action').makeFactoryWithModifier(function (spec) { var namespace = require('../client_action').namespaceFactory; var api = module.exports = {}; -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'reindex', 'snapshot', 'tasks']; +api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; /** * Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request @@ -22,7 +22,10 @@ api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'reindex', 's * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {String} params.type - Default document type for items which don't provide one - * @param {String, String[], Boolean} params.fields - Default comma-separated list of fields to return in the response for updates + * @param {String, String[], Boolean} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request + * @param {String, String[], Boolean} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request + * @param {String, String[], Boolean} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with * @param {String} params.index - Default index for items which don't provide one */ @@ -53,6 +56,17 @@ api.bulk = ca({ fields: { type: 'list' }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, pipeline: { type: 'string' } @@ -97,6 +111,7 @@ api.cat = namespace(); * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return */ @@ -119,6 +134,9 @@ api.cat.prototype.aliases = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -149,6 +167,7 @@ api.cat.prototype.aliases = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information */ @@ -187,6 +206,9 @@ api.cat.prototype.allocation = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -216,6 +238,7 @@ api.cat.prototype.allocation = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ @@ -238,6 +261,9 @@ api.cat.prototype.count = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -268,6 +294,7 @@ api.cat.prototype.count = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return the fielddata size */ @@ -306,6 +333,9 @@ api.cat.prototype.fielddata = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -338,6 +368,7 @@ api.cat.prototype.fielddata = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} [params.ts=true] - Set to false to disable timestamping * @param {Boolean} params.v - Verbose mode. Display column headers */ @@ -360,6 +391,9 @@ api.cat.prototype.health = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, ts: { type: 'boolean', 'default': true @@ -379,12 +413,16 @@ api.cat.prototype.health = ca({ * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by */ api.cat.prototype.help = ca({ params: { help: { type: 'boolean', 'default': false + }, + s: { + type: 'list' } }, url: { @@ -401,8 +439,10 @@ api.cat.prototype.help = ca({ * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {String} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status * @param {Boolean} params.help - Return help information * @param {Boolean} params.pri - Set to true to return stats only for primary shards + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ @@ -430,6 +470,15 @@ api.cat.prototype.indices = ca({ h: { type: 'list' }, + health: { + type: 'enum', + 'default': null, + options: [ + 'green', + 'yellow', + 'red' + ] + }, help: { type: 'boolean', 'default': false @@ -438,6 +487,9 @@ api.cat.prototype.indices = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -467,6 +519,7 @@ api.cat.prototype.indices = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers */ api.cat.prototype.master = ca({ @@ -488,6 +541,9 @@ api.cat.prototype.master = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -507,6 +563,7 @@ api.cat.prototype.master = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers */ api.cat.prototype.nodeattrs = ca({ @@ -528,6 +585,9 @@ api.cat.prototype.nodeattrs = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -547,6 +607,7 @@ api.cat.prototype.nodeattrs = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers */ api.cat.prototype.nodes = ca({ @@ -568,6 +629,9 @@ api.cat.prototype.nodes = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -587,6 +651,7 @@ api.cat.prototype.nodes = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers */ api.cat.prototype.pendingTasks = ca({ @@ -608,6 +673,9 @@ api.cat.prototype.pendingTasks = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -627,6 +695,7 @@ api.cat.prototype.pendingTasks = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers */ api.cat.prototype.plugins = ca({ @@ -648,6 +717,9 @@ api.cat.prototype.plugins = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -667,6 +739,7 @@ api.cat.prototype.plugins = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ @@ -702,6 +775,9 @@ api.cat.prototype.recovery = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -731,6 +807,7 @@ api.cat.prototype.recovery = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers */ api.cat.prototype.repositories = ca({ @@ -753,6 +830,9 @@ api.cat.prototype.repositories = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -770,6 +850,7 @@ api.cat.prototype.repositories = ca({ * @param {String} params.format - a short version of the Accept header, e.g. json, yaml * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ @@ -785,6 +866,9 @@ api.cat.prototype.segments = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -814,6 +898,7 @@ api.cat.prototype.segments = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ @@ -836,6 +921,9 @@ api.cat.prototype.shards = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -865,6 +953,7 @@ api.cat.prototype.shards = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.repository - Name of repository from which to fetch the snapshot information */ @@ -889,19 +978,27 @@ api.cat.prototype.snapshots = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false } }, - url: { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' + urls: [ + { + fmt: '/_cat/snapshots/<%=repository%>', + req: { + repository: { + type: 'list' + } } + }, + { + fmt: '/_cat/snapshots' } - } + ] }); /** @@ -916,6 +1013,7 @@ api.cat.prototype.snapshots = ca({ * @param {Number} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers */ api.cat.prototype.tasks = ca({ @@ -948,6 +1046,9 @@ api.cat.prototype.tasks = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -958,6 +1059,61 @@ api.cat.prototype.tasks = ca({ } }); +/** + * Perform a [cat.templates](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.format - a short version of the Accept header, e.g. json, yaml + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String} params.name - A pattern that returned template names must match + */ +api.cat.prototype.templates = ca({ + params: { + format: { + type: 'string' + }, + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + s: { + type: 'list' + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/templates/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + { + fmt: '/_cat/templates' + } + ] +}); + /** * Perform a [cat.threadPool](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html) request * @@ -968,6 +1124,7 @@ api.cat.prototype.tasks = ca({ * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information + * @param {String, String[], Boolean} params.s - Comma-separated list of column names or column aliases to sort by * @param {Boolean} params.v - Verbose mode. Display column headers * @param {String, String[], Boolean} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output */ @@ -1001,6 +1158,9 @@ api.cat.prototype.threadPool = ca({ type: 'boolean', 'default': false }, + s: { + type: 'list' + }, v: { type: 'boolean', 'default': false @@ -1113,10 +1273,10 @@ api.cluster.prototype.getSettings = ca({ * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {Date, Number} params.timeout - Explicit operation timeout - * @param {Number} params.waitForActiveShards - Wait until the specified number of shards is active + * @param {String} params.waitForActiveShards - Wait until the specified number of shards is active * @param {String} params.waitForNodes - Wait until the specified number of nodes is available * @param {String} params.waitForEvents - Wait until all currently queued events with the given priorty are processed - * @param {Number} params.waitForRelocatingShards - Wait until the specified number of relocating shards is finished + * @param {Boolean} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster * @param {String} params.waitForStatus - Wait until cluster is in a specific state * @param {String, String[], Boolean} params.index - Limit the information returned to a specific index */ @@ -1142,7 +1302,7 @@ api.cluster.prototype.health = ca({ type: 'time' }, waitForActiveShards: { - type: 'number', + type: 'string', name: 'wait_for_active_shards' }, waitForNodes: { @@ -1161,9 +1321,9 @@ api.cluster.prototype.health = ca({ ], name: 'wait_for_events' }, - waitForRelocatingShards: { - type: 'number', - name: 'wait_for_relocating_shards' + waitForNoRelocatingShards: { + type: 'boolean', + name: 'wait_for_no_relocating_shards' }, waitForStatus: { type: 'enum', @@ -1625,6 +1785,89 @@ api.countPercolate = ca({ method: 'POST' }); +/** + * Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {String} params.parent - ID of the parent document + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.routing - Specific routing value + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {Date, Number} params.timestamp - Explicit timestamp for the document + * @param {Date, Number} params.ttl - Expiration time for the document + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type + * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with + * @param {String} params.id - Document ID + * @param {String} params.index - The name of the index + * @param {String} params.type - The type of the document + */ +api.create = ca({ + params: { + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + }, + parent: { + type: 'string' + }, + refresh: { + type: 'enum', + options: [ + 'true', + 'false', + 'wait_for', + '' + ] + }, + routing: { + type: 'string' + }, + timeout: { + type: 'time' + }, + timestamp: { + type: 'time' + }, + ttl: { + type: 'time' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' + }, + pipeline: { + type: 'string' + } + }, + url: { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + needBody: true, + method: 'POST' +}); + /** * Perform a [delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html) request * @@ -1703,9 +1946,6 @@ api['delete'] = ca({ * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) * @param {String} params.df - The field to use as default where no field prefix is given in the query string - * @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return as part of a hit - * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields to return as the field data representation of a field for each hit * @param {Number} params.from - Starting offset (default: 0) * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) @@ -1716,7 +1956,7 @@ api['delete'] = ca({ * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String} params.q - Query in the Lucene query string syntax * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {Date, Number} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. * @param {Number} params.size - Number of hits to return (default: 10) @@ -1726,19 +1966,14 @@ api['delete'] = ca({ * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {String} params.suggestField - Specify which field to use for suggestions - * @param {String} [params.suggestMode=missing] - Specify suggest mode - * @param {Number} params.suggestSize - How many suggestions to return in response - * @param {Text} params.suggestText - The source text for which the suggestions should be returned - * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting * @param {Boolean} params.version - Specify whether to return document version as part of a hit * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting * @param {Boolean} params.refresh - Should the effected indexes be refreshed? + * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {Integer} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {Number} params.scrollSize - Size on the scroll request powering the update_by_query * @param {Boolean} params.waitForCompletion - Should the request should block until the delete-by-query is complete. - * @param {Float} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means set no throttle. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -1763,16 +1998,6 @@ api.deleteByQuery = ca({ df: { type: 'string' }, - explain: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, from: { type: 'number' }, @@ -1820,7 +2045,7 @@ api.deleteByQuery = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -1858,36 +2083,6 @@ api.deleteByQuery = ca({ stats: { type: 'list' }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'text', - name: 'suggest_text' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, version: { type: 'boolean' }, @@ -1898,12 +2093,16 @@ api.deleteByQuery = ca({ refresh: { type: 'boolean' }, + timeout: { + type: 'time', + 'default': '1m' + }, waitForActiveShards: { type: 'string', name: 'wait_for_active_shards' }, scrollSize: { - type: 'integer', + type: 'number', name: 'scroll_size' }, waitForCompletion: { @@ -1912,7 +2111,7 @@ api.deleteByQuery = ca({ name: 'wait_for_completion' }, requestsPerSecond: { - type: 'float', + type: 'number', 'default': 0, name: 'requests_per_second' } @@ -2038,7 +2237,7 @@ api.exists = ca({ * @param {String} params.analyzer - The analyzer for the query string query * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) * @param {String} params.df - The default field for query string query (default: _all) - * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased * @param {String} params.parent - The ID of the parent document @@ -2073,8 +2272,9 @@ api.explain = ca({ df: { type: 'string' }, - fields: { - type: 'list' + storedFields: { + type: 'list', + name: 'stored_fields' }, lenient: { type: 'boolean' @@ -2188,7 +2388,7 @@ api.fieldStats = ca({ * Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response * @param {String} params.parent - The ID of the parent document * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode @@ -2205,8 +2405,9 @@ api.fieldStats = ca({ */ api.get = ca({ params: { - fields: { - type: 'list' + storedFields: { + type: 'list', + name: 'stored_fields' }, parent: { type: 'string' @@ -2384,11 +2585,11 @@ api.getTemplate = ca({ * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) * @param {String} params.parent - ID of the parent document - * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with @@ -2433,7 +2634,7 @@ api.index = ca({ type: 'time' }, ttl: { - type: 'duration' + type: 'time' }, version: { type: 'number' @@ -2999,7 +3200,7 @@ api.indices.prototype.existsType = ca({ } }, url: { - fmt: '/<%=index%>/<%=type%>', + fmt: '/<%=index%>/_mapping/<%=type%>', req: { index: { type: 'list' @@ -3017,7 +3218,7 @@ api.indices.prototype.existsType = ca({ * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.force - 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) - * @param {Boolean} params.waitIfOngoing - 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. + * @param {Boolean} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -4384,7 +4585,6 @@ api.indices.prototype.updateAliases = ca({ * Perform a [indices.upgrade](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) @@ -4393,10 +4593,6 @@ api.indices.prototype.updateAliases = ca({ */ api.indices.prototype.upgrade = ca({ params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, expandWildcards: { type: 'enum', 'default': 'open', @@ -4680,7 +4876,7 @@ api.ingest.prototype.simulate = ca({ * Perform a [mget](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response + * @param {String, String[], Boolean} params.storedFields - A comma-separated list of stored fields to return in the response * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation @@ -4692,8 +4888,9 @@ api.ingest.prototype.simulate = ca({ */ api.mget = ca({ params: { - fields: { - type: 'list' + storedFields: { + type: 'list', + name: 'stored_fields' }, preference: { type: 'string' @@ -4861,7 +5058,7 @@ api.msearch = ca({ }); /** - * Perform a [msearchTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request + * Perform a [msearchTemplate](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.searchType - Search operation type @@ -5169,7 +5366,7 @@ api.nodes.prototype.info = ca({ * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) * @param {Boolean} params.groups - A comma-separated list of search groups for `search` index metric * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. - * @param {String} [params.level=node] - Return indices stats aggregated at node, index or shard level + * @param {String} [params.level=node] - Return indices stats aggregated at index, node or shard level * @param {String, String[], Boolean} params.types - A comma-separated list of document types for the `indexing` index metric * @param {Date, Number} params.timeout - Explicit operation timeout * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics @@ -5200,8 +5397,8 @@ api.nodes.prototype.stats = ca({ type: 'enum', 'default': 'node', options: [ - 'node', 'indices', + 'node', 'shards' ] }, @@ -5530,8 +5727,6 @@ api.putTemplate = ca({ method: 'PUT' }); -api.reindex = namespace(); - /** * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request * @@ -5540,7 +5735,7 @@ api.reindex = namespace(); * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) * @param {Boolean} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {Float} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. */ api.reindex = ca({ params: { @@ -5561,7 +5756,7 @@ api.reindex = ca({ name: 'wait_for_completion' }, requestsPerSecond: { - type: 'float', + type: 'number', 'default': 0, name: 'requests_per_second' } @@ -5574,16 +5769,16 @@ api.reindex = ca({ }); /** - * Perform a [reindex.rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request + * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Float} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. * @param {String} params.taskId - The task id to rethrottle */ -api.reindex.prototype.rethrottle = ca({ +api.reindexRethrottle = ca({ params: { requestsPerSecond: { - type: 'float', + type: 'number', required: true, name: 'requests_per_second' } @@ -5626,13 +5821,13 @@ api.renderSearchTemplate = ca({ * Perform a [scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.scrollId - The scroll ID */ api.scroll = ca({ params: { scroll: { - type: 'duration' + type: 'time' }, scrollId: { type: 'string', @@ -5677,7 +5872,7 @@ api.scroll = ca({ * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String} params.q - Query in the Lucene query string syntax * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {Number} params.size - Number of hits to return (default: 10) * @param {String, String[], Boolean} params.sort - A comma-separated list of : pairs @@ -5689,7 +5884,7 @@ api.scroll = ca({ * @param {String} params.suggestField - Specify which field to use for suggestions * @param {String} [params.suggestMode=missing] - Specify suggest mode * @param {Number} params.suggestSize - How many suggestions to return in response - * @param {Text} params.suggestText - The source text for which the suggestions should be returned + * @param {String} params.suggestText - The source text for which the suggestions should be returned * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting * @param {Boolean} params.version - Specify whether to return document version as part of a hit @@ -5772,7 +5967,7 @@ api.search = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -5825,7 +6020,7 @@ api.search = ca({ name: 'suggest_size' }, suggestText: { - type: 'text', + type: 'string', name: 'suggest_text' }, timeout: { @@ -5950,8 +6145,10 @@ api.searchShards = ca({ * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type + * @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit + * @param {Boolean} params.profile - Specify whether to profile the query execution * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -5983,7 +6180,7 @@ api.searchTemplate = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -5994,6 +6191,12 @@ api.searchTemplate = ca({ 'dfs_query_and_fetch' ], name: 'search_type' + }, + explain: { + type: 'boolean' + }, + profile: { + type: 'boolean' } }, urls: [ @@ -6157,6 +6360,7 @@ api.snapshot.prototype.deleteRepository = ca({ * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown * @param {String} params.repository - A repository name * @param {String, String[], Boolean} params.snapshot - A comma-separated list of snapshot names */ @@ -6165,6 +6369,10 @@ api.snapshot.prototype.get = ca({ masterTimeout: { type: 'time', name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' } }, url: { @@ -6253,6 +6461,7 @@ api.snapshot.prototype.restore = ca({ * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown * @param {String} params.repository - A repository name * @param {String, String[], Boolean} params.snapshot - A comma-separated list of snapshot names */ @@ -6261,6 +6470,10 @@ api.snapshot.prototype.status = ca({ masterTimeout: { type: 'time', name: 'master_timeout' + }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' } }, urls: [ @@ -6614,6 +6827,9 @@ api.termvectors = ca({ * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field * @param {String} params.lang - The script language (default: groovy) * @param {String} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. @@ -6621,7 +6837,7 @@ api.termvectors = ca({ * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.id - Document ID @@ -6637,6 +6853,17 @@ api.update = ca({ fields: { type: 'list' }, + _source: { + type: 'list' + }, + _sourceExclude: { + type: 'list', + name: '_source_exclude' + }, + _sourceInclude: { + type: 'list', + name: '_source_include' + }, lang: { type: 'string' }, @@ -6666,7 +6893,7 @@ api.update = ca({ type: 'time' }, ttl: { - type: 'duration' + type: 'time' }, version: { type: 'number' @@ -6705,13 +6932,10 @@ api.update = ca({ * @param {Boolean} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) * @param {String} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) * @param {String} params.df - The field to use as default where no field prefix is given in the query string - * @param {Boolean} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return as part of a hit - * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields to return as the field data representation of a field for each hit * @param {Number} params.from - Starting offset (default: 0) * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {String} [params.conflicts=abort] - What to do when the reindex hits version conflicts? + * @param {String} [params.conflicts=abort] - What to do when the update by query hits version conflicts? * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {Boolean} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored * @param {Boolean} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased @@ -6719,7 +6943,7 @@ api.update = ca({ * @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {String} params.q - Query in the Lucene query string syntax * @param {String, String[], Boolean} params.routing - A comma-separated list of specific routing values - * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {Date, Number} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {String} params.searchType - Search operation type * @param {Date, Number} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. * @param {Number} params.size - Number of hits to return (default: 10) @@ -6729,20 +6953,15 @@ api.update = ca({ * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {String} params.suggestField - Specify which field to use for suggestions - * @param {String} [params.suggestMode=missing] - Specify suggest mode - * @param {Number} params.suggestSize - How many suggestions to return in response - * @param {Text} params.suggestText - The source text for which the suggestions should be returned - * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {Boolean} params.trackScores - Whether to calculate and return scores even if they are not used for sorting * @param {Boolean} params.version - Specify whether to return document version as part of a hit * @param {Boolean} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) * @param {Boolean} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting * @param {Boolean} params.refresh - Should the effected indexes be refreshed? + * @param {Date, Number} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {Integer} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {Boolean} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {Float} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. + * @param {Number} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {Boolean} params.waitForCompletion - Should the request should block until the update by query operation is complete. + * @param {Number} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -6767,16 +6986,6 @@ api.updateByQuery = ca({ df: { type: 'string' }, - explain: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, from: { type: 'number' }, @@ -6827,7 +7036,7 @@ api.updateByQuery = ca({ type: 'list' }, scroll: { - type: 'duration' + type: 'time' }, searchType: { type: 'enum', @@ -6865,36 +7074,6 @@ api.updateByQuery = ca({ stats: { type: 'list' }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'text', - name: 'suggest_text' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, version: { type: 'boolean' }, @@ -6909,12 +7088,16 @@ api.updateByQuery = ca({ refresh: { type: 'boolean' }, + timeout: { + type: 'time', + 'default': '1m' + }, waitForActiveShards: { type: 'string', name: 'wait_for_active_shards' }, scrollSize: { - type: 'integer', + type: 'number', name: 'scroll_size' }, waitForCompletion: { @@ -6923,7 +7106,7 @@ api.updateByQuery = ca({ name: 'wait_for_completion' }, requestsPerSecond: { - type: 'float', + type: 'number', 'default': 0, name: 'requests_per_second' } @@ -6958,11 +7141,11 @@ api.updateByQuery = ca({ * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) * @param {String} params.parent - ID of the parent document - * @param {String} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + * @param {String} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.timestamp - Explicit timestamp for the document - * @param {Duration} params.ttl - Expiration time for the document + * @param {Date, Number} params.ttl - Expiration time for the document * @param {Number} params.version - Explicit version number for concurrency control * @param {String} params.versionType - Specific version type * @param {String} params.pipeline - The pipeline id to preprocess incoming documents with