diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index db39b2b0f..12a264bbc 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -1,5 +1,5 @@ [[api-reference]] -== 6.5 API +== 6.6 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. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. .Perform three operations in a single request [source,js] @@ -63,16 +63,16 @@ Options::: <>, <>, <> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request `_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 -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request `pipeline`:: <> -- The pipeline id to preprocess incoming documents with `index`:: <> -- Default index for items which don't provide one `body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -86,7 +86,7 @@ client.clearScroll([params, [callback]]) Clear the scroll request created by specifying the scroll parameter to search. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -97,7 +97,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `scrollId`:: <>, <>, <> -- A comma-separated list of scroll IDs to clear `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -111,7 +111,7 @@ client.count([params, [callback]]) Get the number of documents for the cluster, index, type, or a query. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-count.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-count.html[the elasticsearch docs] for more information pertaining to this method. .Get the number of all documents in the cluster [source,js] @@ -153,6 +153,8 @@ const { count } = await client.count({ [horizontal] `ignoreUnavailable`:: <> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`ignoreThrottled`:: +<> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled `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) `[expandWildcards=open]`:: @@ -192,7 +194,7 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of types to restrict the results `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-count.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-count.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -206,7 +208,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. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. .Create a document [source,js] @@ -265,7 +267,7 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-index_.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-index_.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -279,7 +281,7 @@ client.delete([params, [callback]]) Delete a typed JSON document from a specific index based on its id. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. .Delete the document `/myindex/mytype/1` [source,js] @@ -312,6 +314,10 @@ Options::: <> -- Specific routing value `timeout`:: <> -- Explicit operation timeout +`ifSeqNo`:: +<> -- only perform the delete operation if the last operation that has changed the document has the specified sequence number +`ifPrimaryTerm`:: +<> -- only perform the delete operation if the last operation that has changed the document has the specified primary term `version`:: <> -- Explicit version number for concurrency control `versionType`:: @@ -329,7 +335,7 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -343,7 +349,7 @@ client.deleteByQuery([params, [callback]]) Delete documents from one or more indices and one or more types based on a query. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. .Deleting documents with a simple query [source,js] @@ -428,9 +434,9 @@ Options::: <>, <>, <> -- A comma-separated list of : pairs `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `terminateAfter`:: <> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. @@ -459,7 +465,7 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -473,7 +479,7 @@ client.deleteByQueryRethrottle([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -486,7 +492,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `taskId`:: <> -- The task id to rethrottle `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -500,7 +506,7 @@ client.deleteScript([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -515,7 +521,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Script ID `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -529,7 +535,7 @@ client.exists([params, [callback]]) Returns a boolean indicating whether or not a given document exists. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for more information pertaining to this method. .Check that the document `/myindex/mytype/1` exist [source,js] @@ -560,9 +566,9 @@ const exists = await client.exists({ <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `version`:: <> -- Explicit version number for concurrency control @@ -581,7 +587,7 @@ Options::: `type`:: <> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -595,7 +601,7 @@ client.existsSource([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -615,9 +621,9 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `version`:: <> -- Explicit version number for concurrency control @@ -636,7 +642,7 @@ Options::: `type`:: <> -- The type of the document; use `_all` to fetch the first document matching the ID across all types `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -651,7 +657,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. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-explain.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-explain.html[the elasticsearch docs] for more information pertaining to this method. .See how a document is scored against a simple query [source,js] @@ -713,9 +719,9 @@ Options::: <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `id`:: <> -- The document ID @@ -724,7 +730,7 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-explain.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-explain.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -738,7 +744,7 @@ client.fieldCaps([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-field-caps.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-field-caps.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -763,7 +769,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-field-caps.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-field-caps.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -777,7 +783,7 @@ client.get([params, [callback]]) Get a typed JSON document from the index based on its id. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for more information pertaining to this method. .Get `/myindex/mytype/1` [source,js] @@ -808,6 +814,10 @@ const response = await client.get({ <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return +`_sourceExcludes`:: +<>, <>, <> -- A list of fields to exclude from the returned _source field +`_sourceIncludes`:: +<>, <>, <> -- A list of fields to extract and return from the _source field `_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field `_sourceInclude`:: @@ -841,7 +851,7 @@ client.getScript([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -867,7 +877,7 @@ client.getSource([params, [callback]]) Get the source of a document by its index, type and id. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -887,9 +897,9 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `version`:: <> -- Explicit version number for concurrency control @@ -925,7 +935,7 @@ Optimistic concurrency control is performed, when the `version` argument is spec 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 <>. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. .Create or update a document [source,js] @@ -979,6 +989,10 @@ Options::: * `"external_gte"` * `"force"` +`ifSeqNo`:: +<> -- only perform the index operation if the last operation that has changed the document has the specified sequence number +`ifPrimaryTerm`:: +<> -- only perform the index operation if the last operation that has changed the document has the specified primary term `pipeline`:: <> -- The pipeline id to preprocess incoming documents with `id`:: @@ -988,7 +1002,7 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-index_.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-index_.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1018,7 +1032,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. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. .An array of doc locations. Useful for getting documents from different indices. [source,js] @@ -1063,16 +1077,16 @@ const response = await client.mget({ <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `index`:: <> -- The name of the index `type`:: <> -- The type of the document `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1086,7 +1100,7 @@ client.msearch([params, [callback]]) Execute several search requests within the same request. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. .Perform multiple different searches, the body is made up of meta/data pairs [source,js] @@ -1125,12 +1139,14 @@ Options::: <> -- A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. `[maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.]`:: <> -- The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests +`restTotalHitsAsInt`:: +<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `index`:: <>, <>, <> -- A comma-separated list of index names to use as default `type`:: <>, <>, <> -- A comma-separated list of document types to use as default `body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1144,7 +1160,7 @@ client.msearchTemplate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1164,12 +1180,14 @@ Options::: <> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response `maxConcurrentSearches`:: <> -- Controls the maximum number of concurrent searches the multi search api will execute +`restTotalHitsAsInt`:: +<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `index`:: <>, <>, <> -- A comma-separated list of index names to use as default `type`:: <>, <>, <> -- A comma-separated list of document types to use as default `body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1183,7 +1201,7 @@ client.mtermvectors([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1228,7 +1246,7 @@ Options::: `type`:: <> -- The type of the document. `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1258,7 +1276,7 @@ client.putScript([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1275,7 +1293,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Script ID `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1289,7 +1307,7 @@ client.rankEval([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-rank-eval.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-rank-eval.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1312,7 +1330,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-rank-eval.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-rank-eval.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1326,7 +1344,7 @@ client.reindex([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1347,7 +1365,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `[slices=1]`:: <> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1361,7 +1379,7 @@ client.reindexRethrottle([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1374,7 +1392,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `taskId`:: <> -- The task id to rethrottle `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1388,7 +1406,7 @@ client.renderSearchTemplate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1399,7 +1417,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- The id of the stored search template `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1413,7 +1431,7 @@ client.scriptsPainlessExecute([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/painless/6.5/painless-execute-api.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/painless/6.6/painless-execute-api.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1429,7 +1447,7 @@ client.scroll([params, [callback]]) Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. .Collect every title in the index that contains the word "test" [source,js] @@ -1479,8 +1497,10 @@ while (responseQueue.length) { <> -- Specify how long a consistent view of the index should be maintained for scrolled search `scrollId`:: <> -- The scroll ID +`restTotalHitsAsInt`:: +<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1498,7 +1518,7 @@ TIP: https://github.com/danpaz/bodybuilder[bodybuilder] and https://github.com/s -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-search.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-search.html[the elasticsearch docs] for more information pertaining to this method. .Search with a simple query string query [source,js] @@ -1558,6 +1578,8 @@ Options::: <> -- Starting offset (default: 0) `ignoreUnavailable`:: <> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`ignoreThrottled`:: +<> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled `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) `[expandWildcards=open]`:: @@ -1590,9 +1612,9 @@ Options::: <>, <>, <> -- A comma-separated list of : pairs `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `terminateAfter`:: <> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. @@ -1631,12 +1653,14 @@ Options::: <> -- The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests `[preFilterShardSize=128]`:: <> -- A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. +`restTotalHitsAsInt`:: +<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `index`:: <>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `type`:: <>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-search.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-search.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1650,7 +1674,7 @@ client.searchShards([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-shards.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-shards.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1679,7 +1703,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-shards.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-shards.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1693,7 +1717,7 @@ client.searchTemplate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1703,6 +1727,8 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc [horizontal] `ignoreUnavailable`:: <> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`ignoreThrottled`:: +<> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled `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) `[expandWildcards=open]`:: @@ -1733,12 +1759,14 @@ Options::: <> -- Specify whether to profile the query execution `typedKeys`:: <> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response +`restTotalHitsAsInt`:: +<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `index`:: <>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `type`:: <>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1752,7 +1780,7 @@ client.termvectors([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1797,7 +1825,7 @@ Options::: `id`:: <> -- The id of the document, when not specified a doc param should be supplied. `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1814,7 +1842,7 @@ Update parts of a document. The required body parameter can contain one of two t * a partial document, which will be merged with the existing one. * a `script` which will update the document content -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update.html[the elasticsearch docs] for more information pertaining to this method. .Update document title using partial document [source,js] @@ -1889,9 +1917,9 @@ const response = await client.update({ <>, <>, <> -- A comma-separated list of fields to return in the response `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `lang`:: <> -- The script language (default: painless) @@ -1926,7 +1954,7 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -1940,7 +1968,7 @@ client.updateByQuery([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2006,9 +2034,9 @@ Options::: <>, <>, <> -- A comma-separated list of : pairs `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: +`_sourceExcludes`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: +`_sourceIncludes`:: <>, <>, <> -- A list of fields to extract and return from the _source field `terminateAfter`:: <> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. @@ -2039,7 +2067,7 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -2053,7 +2081,7 @@ client.updateByQueryRethrottle([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2066,7 +2094,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `taskId`:: <> -- The task id to rethrottle `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -2080,7 +2108,7 @@ client.cat.aliases([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2117,7 +2145,7 @@ client.cat.allocation([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2169,7 +2197,7 @@ client.cat.count([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-count.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-count.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2206,7 +2234,7 @@ client.cat.fielddata([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2258,7 +2286,7 @@ client.cat.health([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-health.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-health.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2295,7 +2323,7 @@ client.cat.help([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2320,7 +2348,7 @@ client.cat.indices([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2374,7 +2402,7 @@ client.cat.master([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-master.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-master.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2409,7 +2437,7 @@ client.cat.nodeattrs([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2444,7 +2472,7 @@ client.cat.nodes([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2481,7 +2509,7 @@ client.cat.pendingTasks([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2516,7 +2544,7 @@ client.cat.plugins([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2551,7 +2579,7 @@ client.cat.recovery([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2601,7 +2629,7 @@ client.cat.repositories([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2636,7 +2664,7 @@ client.cat.segments([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2684,7 +2712,7 @@ client.cat.shards([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2736,7 +2764,7 @@ client.cat.snapshots([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2773,7 +2801,7 @@ client.cat.tasks([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2812,7 +2840,7 @@ client.cat.templates([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2849,7 +2877,7 @@ client.cat.threadPool([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2896,7 +2924,7 @@ client.cluster.allocationExplain([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2909,7 +2937,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `includeDiskInfo`:: <> -- Return information about disk usage and shard sizes (default: false) `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -2923,7 +2951,7 @@ client.cluster.getSettings([params, [callback]]) Get cluster settings (previously set with `putSettings()`) -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2952,7 +2980,7 @@ client.cluster.health([params, [callback]]) Get a very simple status on the health of the cluster. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3013,7 +3041,7 @@ client.cluster.pendingTasks([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3038,7 +3066,7 @@ client.cluster.putSettings([params, [callback]]) Update cluster wide specific settings. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3053,7 +3081,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `timeout`:: <> -- Explicit operation timeout `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3067,7 +3095,7 @@ client.cluster.remoteInfo([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-remote-info.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-remote-info.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3083,7 +3111,7 @@ client.cluster.reroute([params, [callback]]) Explicitly execute a cluster reroute allocation command including specific commands. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3104,7 +3132,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `timeout`:: <> -- Explicit operation timeout `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3118,7 +3146,7 @@ client.cluster.state([params, [callback]]) Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3132,6 +3160,10 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc <> -- Specify timeout for connection to master `flatSettings`:: <> -- Return settings in flat format (default: false) +`waitForMetadataVersion`:: +<> -- Wait for the metadata version to be equal or greater than the specified metadata version +`waitForTimeout`:: +<> -- The maximum time to wait for wait_for_metadata_version before timing out `ignoreUnavailable`:: <> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) `allowNoIndices`:: @@ -3161,7 +3193,7 @@ client.cluster.stats([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3188,7 +3220,7 @@ client.indices.analyze([params, [callback]]) Perform the analysis process on a text and return the tokens breakdown of the text. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3199,7 +3231,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `index`:: <> -- The name of the index to scope the operation `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3213,7 +3245,7 @@ client.indices.clearCache([params, [callback]]) Clear either all caches or specific cached associated with one ore more indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3248,7 +3280,7 @@ Options::: `request`:: <> -- Clear request cache `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3263,7 +3295,7 @@ client.indices.close([params, [callback]]) Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3290,7 +3322,7 @@ Options::: `index`:: <>, <>, <> -- A comma separated list of indices to close `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3304,7 +3336,7 @@ client.indices.create([params, [callback]]) Create an index in Elasticsearch. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3323,7 +3355,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `index`:: <> -- The name of the index `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3337,7 +3369,7 @@ client.indices.delete([params, [callback]]) Delete an index in Elasticsearch -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3364,7 +3396,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3378,7 +3410,7 @@ client.indices.deleteAlias([params, [callback]]) Delete a specific alias. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3395,7 +3427,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <>, <>, <> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3409,7 +3441,7 @@ client.indices.deleteTemplate([params, [callback]]) Delete an index template by its name. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3424,7 +3456,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <> -- The name of the template `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3438,7 +3470,7 @@ client.indices.exists([params, [callback]]) Return a boolean indicating whether given index exists. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3467,7 +3499,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-exists.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-exists.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3481,7 +3513,7 @@ client.indices.existsAlias([params, [callback]]) Return a boolean indicating whether given alias exists. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3508,7 +3540,7 @@ Options::: `name`:: <>, <>, <> -- A comma-separated list of alias names to return `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3522,7 +3554,7 @@ client.indices.existsTemplate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3539,7 +3571,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <>, <>, <> -- The comma separated names of the index templates `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3553,7 +3585,7 @@ client.indices.existsType([params, [callback]]) Check if a type/types exists in an index/indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3580,7 +3612,7 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of document types to check `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3594,7 +3626,7 @@ client.indices.flush([params, [callback]]) Explicitly flush one or more indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3621,7 +3653,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-flush.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-flush.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3635,7 +3667,7 @@ client.indices.flushSynced([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3658,7 +3690,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3672,7 +3704,7 @@ client.indices.forcemerge([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3701,7 +3733,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -3715,7 +3747,7 @@ client.indices.get([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3758,7 +3790,7 @@ client.indices.getAlias([params, [callback]]) Retrieve a specified alias. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3797,7 +3829,7 @@ client.indices.getFieldMapping([params, [callback]]) Retrieve mapping definition of a specific field. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3840,7 +3872,7 @@ client.indices.getMapping([params, [callback]]) Retrieve mapping definition of index or index/type. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3881,7 +3913,7 @@ client.indices.getSettings([params, [callback]]) Retrieve settings for one or more (or all) indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3926,7 +3958,7 @@ client.indices.getTemplate([params, [callback]]) Retrieve an index template by its name. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3955,7 +3987,7 @@ client.indices.getUpgrade([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3990,7 +4022,7 @@ client.indices.open([params, [callback]]) Open a closed index, making it available for search. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4019,7 +4051,7 @@ Options::: `index`:: <>, <>, <> -- A comma separated list of indices to open `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4033,7 +4065,7 @@ client.indices.putAlias([params, [callback]]) Create an alias for a specific index/indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4050,7 +4082,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <> -- The name of the alias to be created or updated `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4064,7 +4096,7 @@ client.indices.putMapping([params, [callback]]) Register specific mapping definition for a specific type. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4095,7 +4127,7 @@ Options::: `type`:: <> -- The name of the document type `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4109,7 +4141,7 @@ client.indices.putSettings([params, [callback]]) Change specific index level settings in real time. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4140,7 +4172,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4154,7 +4186,7 @@ client.indices.putTemplate([params, [callback]]) Create an index template that will automatically be applied to new indices created. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4175,7 +4207,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <> -- The name of the template `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4189,7 +4221,7 @@ client.indices.recovery([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4216,7 +4248,7 @@ client.indices.refresh([params, [callback]]) Explicitly refresh one or more index, making all operations performed since the last refresh available for search. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4239,7 +4271,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4253,7 +4285,7 @@ client.indices.rollover([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4274,7 +4306,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `newIndex`:: <> -- The name of the rollover index `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4288,7 +4320,7 @@ client.indices.segments([params, [callback]]) Retrieve low level segments information that a Lucene index (shard level) is built with. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4325,7 +4357,7 @@ client.indices.shardStores([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4362,7 +4394,7 @@ client.indices.shrink([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4383,7 +4415,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `target`:: <> -- The name of the target index to shrink into `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4397,7 +4429,7 @@ client.indices.split([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-split-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-split-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4418,7 +4450,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `target`:: <> -- The name of the target index to split into `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-split-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-split-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4432,7 +4464,7 @@ client.indices.stats([params, [callback]]) Retrieve statistics on different operations happening on an index. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4476,7 +4508,7 @@ client.indices.updateAliases([params, [callback]]) Update specified aliases. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. .Perform an atomic alias swap, for a rotating index [source,js] @@ -4501,7 +4533,7 @@ const response = await client.indices.updateAliases({ `masterTimeout`:: <> -- Specify timeout for connection to master `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4515,7 +4547,7 @@ client.indices.upgrade([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4542,7 +4574,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4556,7 +4588,7 @@ client.indices.validateQuery([params, [callback]]) Validate a potentially expensive query without executing it. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-validate.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-validate.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4603,7 +4635,7 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-validate.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-validate.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4617,7 +4649,7 @@ client.ingest.deletePipeline([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4632,7 +4664,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Pipeline ID `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4646,7 +4678,7 @@ client.ingest.getPipeline([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4671,7 +4703,7 @@ client.ingest.processorGrok([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4687,7 +4719,7 @@ client.ingest.putPipeline([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4702,7 +4734,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Pipeline ID `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4716,7 +4748,7 @@ client.ingest.simulate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4729,7 +4761,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Pipeline ID `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4743,7 +4775,7 @@ client.nodes.hotThreads([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4783,7 +4815,7 @@ client.nodes.info([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4812,7 +4844,7 @@ client.nodes.reloadSecureSettings([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4825,7 +4857,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `nodeId`:: <>, <>, <> -- A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4839,7 +4871,7 @@ client.nodes.stats([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4887,7 +4919,7 @@ client.nodes.usage([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-nodes-usage.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-usage.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4914,7 +4946,7 @@ client.snapshot.create([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4931,7 +4963,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `snapshot`:: <> -- A snapshot name `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4945,7 +4977,7 @@ client.snapshot.createRepository([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4962,7 +4994,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `repository`:: <> -- A repository name `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -4976,7 +5008,7 @@ client.snapshot.delete([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4991,7 +5023,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `snapshot`:: <> -- A snapshot name `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -5005,7 +5037,7 @@ client.snapshot.deleteRepository([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5020,7 +5052,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `repository`:: <>, <>, <> -- A comma-separated list of repository names `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -5034,7 +5066,7 @@ client.snapshot.get([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5065,7 +5097,7 @@ client.snapshot.getRepository([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5092,7 +5124,7 @@ client.snapshot.restore([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5109,7 +5141,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `snapshot`:: <> -- A snapshot name `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -5123,7 +5155,7 @@ client.snapshot.status([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5152,7 +5184,7 @@ client.snapshot.verifyRepository([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5167,7 +5199,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `repository`:: <> -- A repository name `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -5181,7 +5213,7 @@ client.tasks.cancel([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5198,7 +5230,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `taskId`:: <> -- Cancel the task with specified task id (node_id:task_number) `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] @@ -5212,7 +5244,7 @@ client.tasks.get([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5239,7 +5271,7 @@ client.tasks.list([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples diff --git a/docs/api_methods_5_0.asciidoc b/docs/api_methods_5_0.asciidoc deleted file mode 100644 index fa3f4f7fc..000000000 --- a/docs/api_methods_5_0.asciidoc +++ /dev/null @@ -1,5258 +0,0 @@ -[[api-reference-5-0]] -== 5.0 API - - -NOTE: At this time, you must opt into the 5.0 API by setting the `apiVersion` config parameter. - - -[[api-bulk-5-0]] -=== `bulk` - -[source,js] --------- -client.bulk([params, [callback]]) --------- - -Perform many index/delete operations in a single API call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform three operations in a single request -[source,js] ---------- -client.bulk({ - body: [ - // action description - { index: { _index: 'myindex', _type: 'mytype', _id: 1 } }, - // the document to index - { title: 'foo' }, - // action description - { update: { _index: 'myindex', _type: 'mytype', _id: 2 } }, - // the document to update - { doc: { title: 'foo' } }, - // action description - { delete: { _index: 'myindex', _type: 'mytype', _id: 3 } }, - // no document needed for this delete - ] -}, function (err, resp) { - // ... -}); ---------- - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- 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`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`type`:: -<> -- Default document type for items which don't provide one -`fields`:: -<>, <>, <> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request -`_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 -`_sourceExclude`:: -<>, <>, <> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -`_sourceInclude`:: -<>, <>, <> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`index`:: -<> -- Default index for items which don't provide one -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-clearscroll-5-0]] -=== `clearScroll` - -[source,js] --------- -client.clearScroll([params, [callback]]) --------- - -Clear the scroll request created by specifying the scroll parameter to search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`scrollId`:: -<>, <>, <> -- A comma-separated list of scroll IDs to clear -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-count-5-0]] -=== `count` - -[source,js] --------- -client.count([params, [callback]]) --------- - -Get the number of documents for the cluster, index, type, or a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-count.html[the elasticsearch docs] for more information pertaining to this method. - -.Get the number of all documents in the cluster -[source,js] ---------- -const { count } = await client.count(); ---------- - -.Get the number of documents in an index -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name' -}); ---------- - -.Get the number of documents matching a query -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name', - body: { - query: { - filtered: { - filter: { - terms: { - foo: ['bar'] - } - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`minScore`:: -<> -- Include only documents with a specific `_score` value in the result -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`lowercaseExpandedTerms`:: -<> -- Specify whether query terms should be lowercased -`index`:: -<>, <>, <> -- A comma-separated list of indices to restrict the results -`type`:: -<>, <>, <> -- A comma-separated list of types to restrict the results -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-count.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-countpercolate-5-0]] -=== `countPercolate` - -[source,js] --------- -client.countPercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to count percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to count percolate document into. Defaults to type. -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being count percolated. -`type`:: -<> -- The type of the document being count percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-create-5-0]] -=== `create` - -[source,js] --------- -client.create([params, [callback]]) --------- - -Adds a typed JSON document in a specific index, making it searchable. If a document with the same `index`, `type`, and `id` already exists, an error will occur. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create a document -[source,js] ---------- -await client.create({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - published_at: '2013-01-01', - counter: 1 - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-delete-5-0]] -=== `delete` - -[source,js] --------- -client.delete([params, [callback]]) --------- - -Delete a typed JSON document from a specific index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. - -.Delete the document `/myindex/mytype/1` -[source,js] ---------- -await client.delete({ - index: 'myindex', - type: 'mytype', - id: '1' -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletebyquery-5-0]] -=== `deleteByQuery` - -[source,js] --------- -client.deleteByQuery([params, [callback]]) --------- - -Delete documents from one or more indices and one or more types based on a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -.Deleting documents with a simple query -[source,js] ---------- -await client.deleteByQuery({ - index: 'myindex', - q: 'test' -}); ---------- - -.Deleting documents using the Query DSL -[source,js] ---------- -await client.deleteByQuery({ - index: 'posts', - body: { - query: { - term: { published: false } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the delete-by-query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`lowercaseExpandedTerms`:: -<> -- Specify whether query terms should be lowercased -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`waitForCompletion`:: -<> -- Should the request should block until the delete-by-query is complete. -`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. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletescript-5-0]] -=== `deleteScript` - -[source,js] --------- -client.deleteScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletetemplate-5-0]] -=== `deleteTemplate` - -[source,js] --------- -client.deleteTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-exists-5-0]] -=== `exists` - -[source,js] --------- -client.exists([params, [callback]]) --------- - -Returns a boolean indicating whether or not a given document exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Check that the document `/myindex/mytype/1` exist -[source,js] ---------- -const exists = await client.exists({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-explain-5-0]] -=== `explain` - -[source,js] --------- -client.explain([params, [callback]]) --------- - -Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-explain.html[the elasticsearch docs] for more information pertaining to this method. - -.See how a document is scored against a simple query -[source,js] ---------- -const response = await client.explain({ - // the document to test - index: 'myindex', - type: 'mytype', - id: '1', - - // the query to score it against - q: 'field:value' -}); ---------- - -.See how a document is scored against a query written in the Query DSL -[source,js] ---------- -const response = await client.explain({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - query: { - match: { title: 'test' } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzeWildcard`:: -<> -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -`analyzer`:: -<> -- The analyzer for the query string query -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The default field for query string query (default: _all) -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`lowercaseExpandedTerms`:: -<> -- Specify whether query terms should be lowercased -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-fieldstats-5-0]] -=== `fieldStats` - -[source,js] --------- -client.fieldStats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-field-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fields`:: -<>, <>, <> -- A comma-separated list of fields for to get field statistics for (min value, max value, and more) -`[level=cluster]`:: -<> -- Defines if field stats should be returned on a per index level or on a cluster wide level -Options::: - * `"indices"` - * `"cluster"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-field-stats.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-get-5-0]] -=== `get` - -[source,js] --------- -client.get([params, [callback]]) --------- - -Get a typed JSON document from the index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Get `/myindex/mytype/1` -[source,js] ---------- -const response = await client.get({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) - -link:#[back to top] - -[[api-getscript-5-0]] -=== `getScript` - -[source,js] --------- -client.getScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language - -link:#[back to top] - -[[api-getsource-5-0]] -=== `getSource` - -[source,js] --------- -client.getSource([params, [callback]]) --------- - -Get the source of a document by its index, type and id. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document; use `_all` to fetch the first document matching the ID across all types - -link:#[back to top] - -[[api-gettemplate-5-0]] -=== `getTemplate` - -[source,js] --------- -client.getTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID - -link:#[back to top] - -[[api-index-5-0]] -=== `index` - -[source,js] --------- -client.index([params, [callback]]) --------- - -Stores a typed JSON document in an index, making it searchable. When the `id` param is not set, a unique id will be auto-generated. When you specify an `id` either a new document will be created, or an existing document will be updated. To enforce "put-if-absent" behavior set the `opType` to `"create"` or use the `create()` method. - -Optimistic concurrency control is performed, when the `version` argument is specified. By default, no version checks are performed. - -By default, the document will be available for `get()` actions immediately, but will only be available for searching after an index refresh (which can happen automatically or manually). See <>. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create or update a document -[source,js] ---------- -const response = await client.index({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -`[opType=index]`:: -<> -- Explicit operation type -Options::: - * `"index"` - * `"create"` - -`parent`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-info-5-0]] -=== `info` - -[source,js] --------- -client.info([params, [callback]]) --------- - -Get basic info from the current cluster. - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-mget-5-0]] -=== `mget` - -[source,js] --------- -client.mget([params, [callback]]) --------- - -Get multiple documents based on an index, type (optional) and ids. The body required by mget can take two forms: an array of document locations, or an array of document ids. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. - -.An array of doc locations. Useful for getting documents from different indices. -[source,js] ---------- -const response = await client.mget({ - body: { - docs: [ - { _index: 'indexA', _type: 'typeA', _id: '1' }, - { _index: 'indexB', _type: 'typeB', _id: '1' }, - { _index: 'indexC', _type: 'typeC', _id: '1' } - ] - } -}); ---------- - -.An array of ids. You must also specify the `index` and `type` that apply to all of the ids. -[source,js] ---------- -const response = await client.mget({ - index: 'myindex', - type: 'mytype', - body: { - ids: [1, 2, 3] - } -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mpercolate-5-0]] -=== `mpercolate` - -[source,js] --------- -client.mpercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<> -- The index of the document being count percolated to use as default -`type`:: -<> -- The type of the document being percolated to use as default. -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearch-5-0]] -=== `msearch` - -[source,js] --------- -client.msearch([params, [callback]]) --------- - -Execute several search requests within the same request. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform multiple different searches, the body is made up of meta/data pairs -[source,js] ---------- -const response = await client.msearch({ - body: [ - // match all query, on all indices and types - {}, - { query: { match_all: {} } }, - - // query_string query, on index/mytype - { index: 'myindex', type: 'mytype' }, - { query: { query_string: { query: '"Test 1"' } } } - ] -}); ---------- - - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`maxConcurrentSearches`:: -<> -- Controls the maximum number of concurrent searches the multi search api will execute -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearchtemplate-5-0]] -=== `msearchTemplate` - -[source,js] --------- -client.msearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mtermvectors-5-0]] -=== `mtermvectors` - -[source,js] --------- -client.mtermvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ids`:: -<>, <>, <> -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body -`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". -`[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". -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[positions=true]`:: -<> -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`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". -`routing`:: -<> -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`parent`:: -<> -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`realtime`:: -<> -- Specifies if requests are real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-percolate-5-0]] -=== `percolate` - -[source,js] --------- -client.percolate([params, [callback]]) --------- - -Match a document against registered percolator queries. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -.First, Register queries named “alert-1” and “alert-2” for the “myindex” index -[source,js] ---------- -await Promise.all([ - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-1', - body: { - // This query will be run against documents sent to percolate - query: { - query_string: { - query: 'foo' - } - } - } - }), - - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-2', - body: { - // This query will also be run against documents sent to percolate - query: { - query_string: { - query: 'bar' - } - } - } - }) -]); ---------- - -.Then you can send documents to learn which query `_percolator` queries they match -[source,js] ---------- -const response1 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo" - } - } -}); - -// response1 should look something like -// { -// total: 1, -// matches: [ { _index: 'myindex', _id: 'alert-1' } ] -// } - -const response2 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo Bar" - } - } -}); - -// response2 should look something like -// { -// total: 2, -// matches: [ -// { _index: 'myindex', _id: 'alert-1' }, -// { _index: 'myindex', _id: 'alert-2' } -// ] -// } ---------- - - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to percolate document into. Defaults to type. -`percolateRouting`:: -<> -- The routing value to use when percolating the existing document. -`percolatePreference`:: -<> -- Which shard to prefer when executing the percolate request. -`percolateFormat`:: -<> -- Return an array of matching query IDs instead of objects -Options::: - * `"ids"` - -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being percolated. -`type`:: -<> -- The type of the document being percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ping-5-0]] -=== `ping` - -[source,js] --------- -client.ping([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-putscript-5-0]] -=== `putScript` - -[source,js] --------- -client.putScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-puttemplate-5-0]] -=== `putTemplate` - -[source,js] --------- -client.putTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindex-5-0]] -=== `reindex` - -[source,js] --------- -client.reindex([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`waitForCompletion`:: -<> -- Should the request should block until the reindex is complete. -`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. -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindexrethrottle-5-0]] -=== `reindexRethrottle` - -[source,js] --------- -client.reindexRethrottle([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`requestsPerSecond`:: -<> -- The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. -`taskId`:: -<> -- The task id to rethrottle -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-rendersearchtemplate-5-0]] -=== `renderSearchTemplate` - -[source,js] --------- -client.renderSearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- The id of the stored search template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-scroll-5-0]] -=== `scroll` - -[source,js] --------- -client.scroll([params, [callback]]) --------- - -Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -.Collect every title in the index that contains the word "test" -[source,js] ---------- -const allTitles = []; -const responseQueue = []; - -// start things off by searching, setting a scroll timeout, and pushing -// our first response into the queue to be processed -await client.search({ - index: 'myindex', - scroll: '30s', // keep the search results "scrollable" for 30 seconds - source: ['title'], // filter the source to only include the title field - q: 'title:test' -}) - -while (responseQueue.length) { - const response = responseQueue.shift(); - - // collect the titles from this response - response.hits.hits.forEach(function (hit) { - allTitles.push(hit.fields.title); - }); - - // check to see if we have collected all of the titles - if (response.hits.total === allTitles.length) { - console.log('every "test" title', allTitles); - break - } - - // get the next response if there are more titles to fetch - responseQueue.push( - await client.scroll({ - scrollId: response._scroll_id, - scroll: '30s' - }) - ); -} ---------- - - - -*Params* - -[horizontal] -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`scrollId`:: -<> -- The scroll ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-search-5-0]] -=== `search` - -[source,js] --------- -client.search([params, [callback]]) --------- - -Return documents matching a query, aggregations/facets, highlighted snippets, suggestions, and more. Write your queries as either http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-uri-request.html[simple query strings] in the `q` parameter, or by specifying a http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html[full request definition] using the http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html[Elasticsearch Query DSL] in the `body` parameter. - -TIP: https://github.com/danpaz/bodybuilder[bodybuilder] and https://github.com/sudo-suhas/elastic-builder[elastic-builder] can be used to make building query bodies easier. - - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Search with a simple query string query -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - q: 'title:test' -}); ---------- - -.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash` -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - body: { - query: { - match: { - title: 'test' - } - }, - facets: { - tags: { - terms: { - field: 'tags' - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return as part of a hit -`docvalueFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`lowercaseExpandedTerms`:: -<> -- Specify whether query terms should be lowercased -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`suggestField`:: -<> -- Specify which field to use for suggestions -`[suggestMode=missing]`:: -<> -- Specify suggest mode -Options::: - * `"missing"` - * `"popular"` - * `"always"` - -`suggestSize`:: -<> -- How many suggestions to return in response -`suggestText`:: -<> -- The source text for which the suggestions should be returned -`timeout`:: -<> -- Explicit operation timeout -`trackScores`:: -<> -- Whether to calculate and return scores even if they are not used for sorting -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchshards-5-0]] -=== `searchShards` - -[source,js] --------- -client.searchShards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-shards.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchtemplate-5-0]] -=== `searchTemplate` - -[source,js] --------- -client.searchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-suggest-5-0]] -=== `suggest` - -[source,js] --------- -client.suggest([params, [callback]]) --------- - -The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-suggesters.html[the elasticsearch docs] for more information pertaining to this method. - -.Return query terms suggestions (“auto-correction”) -[source,js] ---------- -const response = await client.suggest({ - index: 'myindex', - body: { - mysuggester: { - text: 'tset', - term: { - field: 'title' - } - } - } -}); - -// response will be formatted like so: -// -// { -// ... -// mysuggester: [ -// { -// text: "tset", -// ... -// options: [ -// { -// text: "test", -// score: 0.75, -// freq: 5 -// } -// ] -// } -// ] -// } - ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-suggesters.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-termvectors-5-0]] -=== `termvectors` - -[source,js] --------- -client.termvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`termStatistics`:: -<> -- Specifies if total term frequency and document frequency should be returned. -`[fieldStatistics=true]`:: -<> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. -`[positions=true]`:: -<> -- Specifies if term positions should be returned. -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random). -`routing`:: -<> -- Specific routing value. -`parent`:: -<> -- Parent id of documents. -`realtime`:: -<> -- Specifies if request is real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`id`:: -<> -- The id of the document, when not specified a doc param should be supplied. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-update-5-0]] -=== `update` - -[source,js] --------- -client.update([params, [callback]]) --------- - -Update parts of a document. The required body parameter can contain one of two things: - - * a partial document, which will be merged with the existing one. - * a `script` which will update the document content - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update.html[the elasticsearch docs] for more information pertaining to this method. - -.Update document title using partial document -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - // put the partial document under the `doc` key - doc: { - title: 'Updated' - } - } -}) ---------- - -.Add a tag to document `tags` property using a `script` -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags += tag', - params: { tag: 'some new tag' } - } -}); ---------- - -.Increment a document counter by 1 or initialize it, when the document does not exist -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '777', - body: { - script: 'ctx._source.counter += 1', - upsert: { - counter: 1 - } - } -}) ---------- - -.Delete a document if it's tagged “to-delete” -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"', - params: { - tag: 'to-delete' - } - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<>, <>, <> -- A comma-separated list of fields to return in the response -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`lang`:: -<> -- The script language (default: groovy) -`parent`:: -<> -- ID of the parent document. Is is only used for routing and when for the upsert request -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`retryOnConflict`:: -<> -- Specify how many times should the operation be retried when a conflict occurs (default: 0) -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"force"` - -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-updatebyquery-5-0]] -=== `updateByQuery` - -[source,js] --------- -client.updateByQuery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the update by query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`lowercaseExpandedTerms`:: -<> -- Specify whether query terms should be lowercased -`pipeline`:: -<> -- Ingest pipeline to set on index requests made by this action. (default: none) -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`versionType`:: -<> -- Should the document increment the version number (internal) on hit or not (reindex) -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`waitForCompletion`:: -<> -- Should the request should block until the update by query operation is complete. -`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. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cat-aliases-5-0]] -=== `cat.aliases` - -[source,js] --------- -client.cat.aliases([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-cat-allocation-5-0]] -=== `cat.allocation` - -[source,js] --------- -client.cat.allocation([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`nodeId`:: -<>, <>, <> -- A comma-separated list of node IDs or names to limit the returned information - -link:#[back to top] - -[[api-cat-count-5-0]] -=== `cat.count` - -[source,js] --------- -client.cat.count([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-count.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-fielddata-5-0]] -=== `cat.fielddata` - -[source,js] --------- -client.cat.fielddata([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return the fielddata size - -link:#[back to top] - -[[api-cat-health-5-0]] -=== `cat.health` - -[source,js] --------- -client.cat.health([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`[ts=true]`:: -<> -- Set to false to disable timestamping -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-help-5-0]] -=== `cat.help` - -[source,js] --------- -client.cat.help([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`help`:: -<> -- Return help information - -link:#[back to top] - -[[api-cat-indices-5-0]] -=== `cat.indices` - -[source,js] --------- -client.cat.indices([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"m"` - * `"g"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`health`:: -<> -- A health status ("green", "yellow", or "red" to filter only indices matching the specified health status -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`help`:: -<> -- Return help information -`pri`:: -<> -- Set to true to return stats only for primary shards -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-master-5-0]] -=== `cat.master` - -[source,js] --------- -client.cat.master([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-master.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodeattrs-5-0]] -=== `cat.nodeattrs` - -[source,js] --------- -client.cat.nodeattrs([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodes-5-0]] -=== `cat.nodes` - -[source,js] --------- -client.cat.nodes([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`fullId`:: -<> -- Return the full node ID instead of the shortened version (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-pendingtasks-5-0]] -=== `cat.pendingTasks` - -[source,js] --------- -client.cat.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-plugins-5-0]] -=== `cat.plugins` - -[source,js] --------- -client.cat.plugins([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-recovery-5-0]] -=== `cat.recovery` - -[source,js] --------- -client.cat.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-repositories-5-0]] -=== `cat.repositories` - -[source,js] --------- -client.cat.repositories([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-segments-5-0]] -=== `cat.segments` - -[source,js] --------- -client.cat.segments([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-shards-5-0]] -=== `cat.shards` - -[source,js] --------- -client.cat.shards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-snapshots-5-0]] -=== `cat.snapshots` - -[source,js] --------- -client.cat.snapshots([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`ignoreUnavailable`:: -<> -- Set to true to ignore unavailable snapshots -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`repository`:: -<>, <>, <> -- Name of repository from which to fetch the snapshot information - -link:#[back to top] - -[[api-cat-tasks-5-0]] -=== `cat.tasks` - -[source,js] --------- -client.cat.tasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id. Set to -1 to return all. -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-threadpool-5-0]] -=== `cat.threadPool` - -[source,js] --------- -client.cat.threadPool([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`size`:: -<> -- The multiplier in which to display values -Options::: - * `""` - * `"k"` - * `"m"` - * `"g"` - * `"t"` - * `"p"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`v`:: -<> -- Verbose mode. Display column headers -`threadPoolPatterns`:: -<>, <>, <> -- A comma-separated list of regular-expressions to filter the thread pools in the output - -link:#[back to top] - -[[api-cluster-allocationexplain-5-0]] -=== `cluster.allocationExplain` - -[source,js] --------- -client.cluster.allocationExplain([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeYesDecisions`:: -<> -- Return 'YES' decisions in explanation (default: false) -`includeDiskInfo`:: -<> -- Return information about disk usage and shard sizes (default: false) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-getsettings-5-0]] -=== `cluster.getSettings` - -[source,js] --------- -client.cluster.getSettings([params, [callback]]) --------- - -Get cluster settings (previously set with `putSettings()`) - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`includeDefaults`:: -<> -- Whether to return all default clusters setting. - -link:#[back to top] - -[[api-cluster-health-5-0]] -=== `cluster.health` - -[source,js] --------- -client.cluster.health([params, [callback]]) --------- - -Get a very simple status on the health of the cluster. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`[level=cluster]`:: -<> -- Specify the level of detail for returned information -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`waitForActiveShards`:: -<> -- Wait until the specified number of shards is active -`waitForNodes`:: -<> -- Wait until the specified number of nodes is available -`waitForEvents`:: -<> -- Wait until all currently queued events with the given priority are processed -Options::: - * `"immediate"` - * `"urgent"` - * `"high"` - * `"normal"` - * `"low"` - * `"languid"` - -`waitForNoRelocatingShards`:: -<> -- Whether to wait until there are no relocating shards in the cluster -`waitForStatus`:: -<> -- Wait until cluster is in a specific state -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`index`:: -<>, <>, <> -- Limit the information returned to a specific index - -link:#[back to top] - -[[api-cluster-pendingtasks-5-0]] -=== `cluster.pendingTasks` - -[source,js] --------- -client.cluster.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master - -link:#[back to top] - -[[api-cluster-putsettings-5-0]] -=== `cluster.putSettings` - -[source,js] --------- -client.cluster.putSettings([params, [callback]]) --------- - -Update cluster wide specific settings. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-reroute-5-0]] -=== `cluster.reroute` - -[source,js] --------- -client.cluster.reroute([params, [callback]]) --------- - -Explicitly execute a cluster reroute allocation command including specific commands. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`dryRun`:: -<> -- Simulate the operation only and return the resulting state -`explain`:: -<> -- Return an explanation of why the commands can or cannot be executed -`retryFailed`:: -<> -- Retries allocation of shards that are blocked due to too many subsequent allocation failures -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics. Defaults to all but metadata -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-state-5-0]] -=== `cluster.state` - -[source,js] --------- -client.cluster.state([params, [callback]]) --------- - -Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics - -link:#[back to top] - -[[api-cluster-stats-5-0]] -=== `cluster.stats` - -[source,js] --------- -client.cluster.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-indices-analyze-5-0]] -=== `indices.analyze` - -[source,js] --------- -client.indices.analyze([params, [callback]]) --------- - -Perform the analysis process on a text and return the tokens breakdown of the text. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The name of the analyzer to use -`charFilter`:: -<>, <>, <> -- A comma-separated list of character filters to use for the analysis -`field`:: -<> -- Use the analyzer configured for this field (instead of passing the analyzer name) -`filter`:: -<>, <>, <> -- A comma-separated list of filters to use for the analysis -`index`:: -<> -- The name of the index to scope the operation -`preferLocal`:: -<> -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) -`text`:: -<>, <>, <> -- The text on which the analysis should be performed (when request body is not used) -`tokenizer`:: -<> -- The name of the tokenizer to use for the analysis -`explain`:: -<> -- With `true`, outputs more advanced details. (default: false) -`attributes`:: -<>, <>, <> -- A comma-separated list of token attributes to output, this parameter works only with `explain=true` -`[format=detailed]`:: -<> -- Format of the output -Options::: - * `"detailed"` - * `"text"` - -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-clearcache-5-0]] -=== `indices.clearCache` - -[source,js] --------- -client.indices.clearCache([params, [callback]]) --------- - -Clear either all caches or specific cached associated with one ore more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fieldData`:: -<> -- Clear field data -`fielddata`:: -<> -- Clear field data -`fields`:: -<>, <>, <> -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all) -`query`:: -<> -- Clear query caches -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index name to limit the operation -`recycler`:: -<> -- Clear the recycler cache -`request`:: -<> -- Clear request cache -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-close-5-0]] -=== `indices.close` - -[source,js] --------- -client.indices.close([params, [callback]]) --------- - -Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to close -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-create-5-0]] -=== `indices.create` - -[source,js] --------- -client.indices.create([params, [callback]]) --------- - -Create an index in Elasticsearch. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for before the operation returns. -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`index`:: -<> -- The name of the index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-delete-5-0]] -=== `indices.delete` - -[source,js] --------- -client.indices.delete([params, [callback]]) --------- - -Delete an index in Elasticsearch - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletealias-5-0]] -=== `indices.deleteAlias` - -[source,js] --------- -client.indices.deleteAlias([params, [callback]]) --------- - -Delete a specific alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names (supports wildcards); use `_all` for all indices -`name`:: -<>, <>, <> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletetemplate-5-0]] -=== `indices.deleteTemplate` - -[source,js] --------- -client.indices.deleteTemplate([params, [callback]]) --------- - -Delete an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-exists-5-0]] -=== `indices.exists` - -[source,js] --------- -client.indices.exists([params, [callback]]) --------- - -Return a boolean indicating whether given index exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of indices to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existsalias-5-0]] -=== `indices.existsAlias` - -[source,js] --------- -client.indices.existsAlias([params, [callback]]) --------- - -Return a boolean indicating whether given alias exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstemplate-5-0]] -=== `indices.existsTemplate` - -[source,js] --------- -client.indices.existsTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstype-5-0]] -=== `indices.existsType` - -[source,js] --------- -client.indices.existsType([params, [callback]]) --------- - -Check if a type/types exists in an index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` to check the types across all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flush-5-0]] -=== `indices.flush` - -[source,js] --------- -client.indices.flush([params, [callback]]) --------- - -Explicitly flush one or more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`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. -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flushsynced-5-0]] -=== `indices.flushSynced` - -[source,js] --------- -client.indices.flushSynced([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-forcemerge-5-0]] -=== `indices.forcemerge` - -[source,js] --------- -client.indices.forcemerge([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flush`:: -<> -- Specify whether the index should be flushed after performing the operation (default: true) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`maxNumSegments`:: -<> -- The number of segments the index should be merged into (default: dynamic) -`onlyExpungeDeletes`:: -<> -- Specify whether the operation should only expunge deleted documents -`operationThreading`:: -anything -- TODO: ? -`waitForMerge`:: -<> -- Specify whether the request should block until the merge process is finished (default: true) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-get-5-0]] -=== `indices.get` - -[source,js] --------- -client.indices.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Ignore unavailable indexes (default: false) -`allowNoIndices`:: -<> -- Ignore if a wildcard expression resolves to no concrete indices (default: false) -`[expandWildcards=open]`:: -<> -- Whether wildcard expressions should get expanded to open or closed indices (default: open) -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return version and creation date values in human-readable format. -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names -`feature`:: -<>, <>, <> -- A comma-separated list of features - -link:#[back to top] - -[[api-indices-getalias-5-0]] -=== `indices.getAlias` - -[source,js] --------- -client.indices.getAlias([params, [callback]]) --------- - -Retrieve a specified alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=all]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-indices-getfieldmapping-5-0]] -=== `indices.getFieldMapping` - -[source,js] --------- -client.indices.getFieldMapping([params, [callback]]) --------- - -Retrieve mapping definition of a specific field. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeDefaults`:: -<> -- Whether the default mapping values should be returned as well -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types -`fields`:: -<>, <>, <> -- A comma-separated list of fields - -link:#[back to top] - -[[api-indices-getmapping-5-0]] -=== `indices.getMapping` - -[source,js] --------- -client.indices.getMapping([params, [callback]]) --------- - -Retrieve mapping definition of index or index/type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types - -link:#[back to top] - -[[api-indices-getsettings-5-0]] -=== `indices.getSettings` - -[source,js] --------- -client.indices.getSettings([params, [callback]]) --------- - -Retrieve settings for one or more (or all) indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`human`:: -<> -- Whether to return version and creation date values in human-readable format. -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`name`:: -<>, <>, <> -- The name of the settings that should be included - -link:#[back to top] - -[[api-indices-gettemplate-5-0]] -=== `indices.getTemplate` - -[source,js] --------- -client.indices.getTemplate([params, [callback]]) --------- - -Retrieve an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<>, <>, <> -- The comma separated names of the index templates - -link:#[back to top] - -[[api-indices-getupgrade-5-0]] -=== `indices.getUpgrade` - -[source,js] --------- -client.indices.getUpgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-open-5-0]] -=== `indices.open` - -[source,js] --------- -client.indices.open([params, [callback]]) --------- - -Open a closed index, making it available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to open -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putalias-5-0]] -=== `indices.putAlias` - -[source,js] --------- -client.indices.putAlias([params, [callback]]) --------- - -Create an alias for a specific index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -`name`:: -<> -- The name of the alias to be created or updated -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putmapping-5-0]] -=== `indices.putMapping` - -[source,js] --------- -client.indices.putMapping([params, [callback]]) --------- - -Register specific mapping definition for a specific type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`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. -`type`:: -<> -- The name of the document type -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putsettings-5-0]] -=== `indices.putSettings` - -[source,js] --------- -client.indices.putSettings([params, [callback]]) --------- - -Change specific index level settings in real time. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Specify timeout for connection to master -`preserveExisting`:: -<> -- Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-puttemplate-5-0]] -=== `indices.putTemplate` - -[source,js] --------- -client.indices.putTemplate([params, [callback]]) --------- - -Create an index template that will automatically be applied to new indices created. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`order`:: -<> -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) -`create`:: -<> -- Whether the index template should only be added if new or can also replace an existing one -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-recovery-5-0]] -=== `indices.recovery` - -[source,js] --------- -client.indices.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`detailed`:: -<> -- Whether to display detailed information about shard recovery -`activeOnly`:: -<> -- Display only those recoveries that are currently on-going -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`index`:: -<>, <>, <> -- 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-5-0]] -=== `indices.refresh` - -[source,js] --------- -client.indices.refresh([params, [callback]]) --------- - -Explicitly refresh one or more index, making all operations performed since the last refresh available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-rollover-5-0]] -=== `indices.rollover` - -[source,js] --------- -client.indices.rollover([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`dryRun`:: -<> -- If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the newly created rollover index before the operation returns. -`alias`:: -<> -- The name of the alias to rollover -`newIndex`:: -<> -- The name of the rollover index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-segments-5-0]] -=== `indices.segments` - -[source,js] --------- -client.indices.segments([params, [callback]]) --------- - -Retrieve low level segments information that a Lucene index (shard level) is built with. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`operationThreading`:: -anything -- TODO: ? -`verbose`:: -<> -- Includes detailed memory usage by Lucene. -`index`:: -<>, <>, <> -- 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-5-0]] -=== `indices.shardStores` - -[source,js] --------- -client.indices.shardStores([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`status`:: -<>, <>, <> -- A comma-separated list of statuses used to filter on shards to get store information for -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-shrink-5-0]] -=== `indices.shrink` - -[source,js] --------- -client.indices.shrink([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the shrunken index before the operation returns. -`index`:: -<> -- The name of the source index to shrink -`target`:: -<> -- The name of the target index to shrink into -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-stats-5-0]] -=== `indices.stats` - -[source,js] --------- -client.indices.stats([params, [callback]]) --------- - -Retrieve statistics on different operations happening on an index. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<>, <>, <> -- A comma-separated list of search groups for `search` index metric -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`[level=indices]`:: -<> -- Return stats aggregated at cluster, index or shard level -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned the specific metrics. - -link:#[back to top] - -[[api-indices-updatealiases-5-0]] -=== `indices.updateAliases` - -[source,js] --------- -client.indices.updateAliases([params, [callback]]) --------- - -Update specified aliases. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform an atomic alias swap, for a rotating index -[source,js] ---------- -const response = await client.indices.updateAliases({ - body: { - actions: [ - { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } }, - { add: { index: 'logstash-2014.05', alias: 'logstash-current' } } - ] - } -}); ---------- - - - -*Params* - -[horizontal] -`timeout`:: -<> -- Request timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-upgrade-5-0]] -=== `indices.upgrade` - -[source,js] --------- -client.indices.upgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`waitForCompletion`:: -<> -- Specify whether the request should block until the all segments are upgraded (default: false) -`onlyAncientSegments`:: -<> -- If true, only ancient (an older Lucene major release) segments will be upgraded -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-validatequery-5-0]] -=== `indices.validateQuery` - -[source,js] --------- -client.indices.validateQuery([params, [callback]]) --------- - -Validate a potentially expensive query without executing it. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-validate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`explain`:: -<> -- Return detailed information about the error -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`lowercaseExpandedTerms`:: -<> -- Specify whether query terms should be lowercased -`rewrite`:: -<> -- Provide a more detailed explanation showing the actual Lucene query that will be executed. -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-validate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-deletepipeline-5-0]] -=== `ingest.deletePipeline` - -[source,js] --------- -client.ingest.deletePipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-getpipeline-5-0]] -=== `ingest.getPipeline` - -[source,js] --------- -client.ingest.getPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`id`:: -<> -- Comma separated list of pipeline ids. Wildcards supported - -link:#[back to top] - -[[api-ingest-putpipeline-5-0]] -=== `ingest.putPipeline` - -[source,js] --------- -client.ingest.putPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-simulate-5-0]] -=== `ingest.simulate` - -[source,js] --------- -client.ingest.simulate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`verbose`:: -<> -- Verbose mode. Display data output for each processor in executed pipeline -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-nodes-hotthreads-5-0]] -=== `nodes.hotThreads` - -[source,js] --------- -client.nodes.hotThreads([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`interval`:: -<> -- The interval for the second sampling of threads -`snapshots`:: -<> -- Number of samples of thread stacktrace (default: 10) -`threads`:: -<> -- Specify the number of threads to provide information for (default: 3) -`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) -`type`:: -<> -- The type to sample (default: cpu) -Options::: - * `"cpu"` - * `"wait"` - * `"block"` - -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-nodes-info-5-0]] -=== `nodes.info` - -[source,js] --------- -client.nodes.info([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`timeout`:: -<> -- Explicit operation timeout -`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 -`metric`:: -<>, <>, <> -- A comma-separated list of metrics you wish returned. Leave empty to return all. - -link:#[back to top] - -[[api-nodes-stats-5-0]] -=== `nodes.stats` - -[source,js] --------- -client.nodes.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<> -- A comma-separated list of search groups for `search` index metric -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`[level=node]`:: -<> -- Return indices stats aggregated at index, node or shard level -Options::: - * `"indices"` - * `"node"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`timeout`:: -<> -- Explicit operation timeout -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics -`indexMetric`:: -<>, <>, <> -- Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. -`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 - -link:#[back to top] - -[[api-snapshot-create-5-0]] -=== `snapshot.create` - -[source,js] --------- -client.snapshot.create([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-createrepository-5-0]] -=== `snapshot.createRepository` - -[source,js] --------- -client.snapshot.createRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`verify`:: -<> -- Whether to verify the repository after creation -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-delete-5-0]] -=== `snapshot.delete` - -[source,js] --------- -client.snapshot.delete([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-deleterepository-5-0]] -=== `snapshot.deleteRepository` - -[source,js] --------- -client.snapshot.deleteRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<>, <>, <> -- A comma-separated list of repository names -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-get-5-0]] -=== `snapshot.get` - -[source,js] --------- -client.snapshot.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-getrepository-5-0]] -=== `snapshot.getRepository` - -[source,js] --------- -client.snapshot.getRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`repository`:: -<>, <>, <> -- A comma-separated list of repository names - -link:#[back to top] - -[[api-snapshot-restore-5-0]] -=== `snapshot.restore` - -[source,js] --------- -client.snapshot.restore([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-status-5-0]] -=== `snapshot.status` - -[source,js] --------- -client.snapshot.status([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-verifyrepository-5-0]] -=== `snapshot.verifyRepository` - -[source,js] --------- -client.snapshot.verifyRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-cancel-5-0]] -=== `tasks.cancel` - -[source,js] --------- -client.tasks.cancel([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all. -`parentNode`:: -<> -- Cancel tasks with specified parent node. -`parentTask`:: -<> -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. -`taskId`:: -<> -- Cancel the task with specified task id (node_id:task_number) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-get-5-0]] -=== `tasks.get` - -[source,js] --------- -client.tasks.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`taskId`:: -<> -- Return the task with specified id (node_id:task_number) - -link:#[back to top] - -[[api-tasks-list-5-0]] -=== `tasks.list` - -[source,js] --------- -client.tasks.list([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`[groupBy=nodes]`:: -<> -- Group tasks by nodes or parent/child relationships -Options::: - * `"nodes"` - * `"parents"` - - -link:#[back to top] diff --git a/docs/api_methods_5_1.asciidoc b/docs/api_methods_5_1.asciidoc deleted file mode 100644 index cc68e7604..000000000 --- a/docs/api_methods_5_1.asciidoc +++ /dev/null @@ -1,5335 +0,0 @@ -[[api-reference-5-1]] -== 5.1 API - - -NOTE: At this time, you must opt into the 5.1 API by setting the `apiVersion` config parameter. - - -[[api-bulk-5-1]] -=== `bulk` - -[source,js] --------- -client.bulk([params, [callback]]) --------- - -Perform many index/delete operations in a single API call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform three operations in a single request -[source,js] ---------- -client.bulk({ - body: [ - // action description - { index: { _index: 'myindex', _type: 'mytype', _id: 1 } }, - // the document to index - { title: 'foo' }, - // action description - { update: { _index: 'myindex', _type: 'mytype', _id: 2 } }, - // the document to update - { doc: { title: 'foo' } }, - // action description - { delete: { _index: 'myindex', _type: 'mytype', _id: 3 } }, - // no document needed for this delete - ] -}, function (err, resp) { - // ... -}); ---------- - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- 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`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`type`:: -<> -- Default document type for items which don't provide one -`fields`:: -<>, <>, <> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request -`_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 -`_sourceExclude`:: -<>, <>, <> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -`_sourceInclude`:: -<>, <>, <> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`index`:: -<> -- Default index for items which don't provide one -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-clearscroll-5-1]] -=== `clearScroll` - -[source,js] --------- -client.clearScroll([params, [callback]]) --------- - -Clear the scroll request created by specifying the scroll parameter to search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`scrollId`:: -<>, <>, <> -- A comma-separated list of scroll IDs to clear -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-count-5-1]] -=== `count` - -[source,js] --------- -client.count([params, [callback]]) --------- - -Get the number of documents for the cluster, index, type, or a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-count.html[the elasticsearch docs] for more information pertaining to this method. - -.Get the number of all documents in the cluster -[source,js] ---------- -const { count } = await client.count(); ---------- - -.Get the number of documents in an index -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name' -}); ---------- - -.Get the number of documents matching a query -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name', - body: { - query: { - filtered: { - filter: { - terms: { - foo: ['bar'] - } - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`minScore`:: -<> -- Include only documents with a specific `_score` value in the result -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`index`:: -<>, <>, <> -- A comma-separated list of indices to restrict the results -`type`:: -<>, <>, <> -- A comma-separated list of types to restrict the results -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-count.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-countpercolate-5-1]] -=== `countPercolate` - -[source,js] --------- -client.countPercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to count percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to count percolate document into. Defaults to type. -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being count percolated. -`type`:: -<> -- The type of the document being count percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-create-5-1]] -=== `create` - -[source,js] --------- -client.create([params, [callback]]) --------- - -Adds a typed JSON document in a specific index, making it searchable. If a document with the same `index`, `type`, and `id` already exists, an error will occur. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create a document -[source,js] ---------- -await client.create({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - published_at: '2013-01-01', - counter: 1 - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-delete-5-1]] -=== `delete` - -[source,js] --------- -client.delete([params, [callback]]) --------- - -Delete a typed JSON document from a specific index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. - -.Delete the document `/myindex/mytype/1` -[source,js] ---------- -await client.delete({ - index: 'myindex', - type: 'mytype', - id: '1' -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-delete.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletebyquery-5-1]] -=== `deleteByQuery` - -[source,js] --------- -client.deleteByQuery([params, [callback]]) --------- - -Delete documents from one or more indices and one or more types based on a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -.Deleting documents with a simple query -[source,js] ---------- -await client.deleteByQuery({ - index: 'myindex', - q: 'test' -}); ---------- - -.Deleting documents using the Query DSL -[source,js] ---------- -await client.deleteByQuery({ - index: 'posts', - body: { - query: { - term: { published: false } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the delete-by-query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`waitForCompletion`:: -<> -- Should the request should block until the delete-by-query is complete. -`requestsPerSecond`:: -<> -- The throttle for this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletescript-5-1]] -=== `deleteScript` - -[source,js] --------- -client.deleteScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletetemplate-5-1]] -=== `deleteTemplate` - -[source,js] --------- -client.deleteTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-exists-5-1]] -=== `exists` - -[source,js] --------- -client.exists([params, [callback]]) --------- - -Returns a boolean indicating whether or not a given document exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Check that the document `/myindex/mytype/1` exist -[source,js] ---------- -const exists = await client.exists({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-explain-5-1]] -=== `explain` - -[source,js] --------- -client.explain([params, [callback]]) --------- - -Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-explain.html[the elasticsearch docs] for more information pertaining to this method. - -.See how a document is scored against a simple query -[source,js] ---------- -const response = await client.explain({ - // the document to test - index: 'myindex', - type: 'mytype', - id: '1', - - // the query to score it against - q: 'field:value' -}); ---------- - -.See how a document is scored against a query written in the Query DSL -[source,js] ---------- -const response = await client.explain({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - query: { - match: { title: 'test' } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzeWildcard`:: -<> -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -`analyzer`:: -<> -- The analyzer for the query string query -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The default field for query string query (default: _all) -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-fieldstats-5-1]] -=== `fieldStats` - -[source,js] --------- -client.fieldStats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-field-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fields`:: -<>, <>, <> -- A comma-separated list of fields for to get field statistics for (min value, max value, and more) -`[level=cluster]`:: -<> -- Defines if field stats should be returned on a per index level or on a cluster wide level -Options::: - * `"indices"` - * `"cluster"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-field-stats.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-get-5-1]] -=== `get` - -[source,js] --------- -client.get([params, [callback]]) --------- - -Get a typed JSON document from the index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Get `/myindex/mytype/1` -[source,js] ---------- -const response = await client.get({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) - -link:#[back to top] - -[[api-getscript-5-1]] -=== `getScript` - -[source,js] --------- -client.getScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language - -link:#[back to top] - -[[api-getsource-5-1]] -=== `getSource` - -[source,js] --------- -client.getSource([params, [callback]]) --------- - -Get the source of a document by its index, type and id. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document; use `_all` to fetch the first document matching the ID across all types - -link:#[back to top] - -[[api-gettemplate-5-1]] -=== `getTemplate` - -[source,js] --------- -client.getTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID - -link:#[back to top] - -[[api-index-5-1]] -=== `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 <>. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create or update a document -[source,js] ---------- -const response = await client.index({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -`[opType=index]`:: -<> -- Explicit operation type -Options::: - * `"index"` - * `"create"` - -`parent`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-info-5-1]] -=== `info` - -[source,js] --------- -client.info([params, [callback]]) --------- - -Get basic info from the current cluster. - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-mget-5-1]] -=== `mget` - -[source,js] --------- -client.mget([params, [callback]]) --------- - -Get multiple documents based on an index, type (optional) and ids. The body required by mget can take two forms: an array of document locations, or an array of document ids. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. - -.An array of doc locations. Useful for getting documents from different indices. -[source,js] ---------- -const response = await client.mget({ - body: { - docs: [ - { _index: 'indexA', _type: 'typeA', _id: '1' }, - { _index: 'indexB', _type: 'typeB', _id: '1' }, - { _index: 'indexC', _type: 'typeC', _id: '1' } - ] - } -}); ---------- - -.An array of ids. You must also specify the `index` and `type` that apply to all of the ids. -[source,js] ---------- -const response = await client.mget({ - index: 'myindex', - type: 'mytype', - body: { - ids: [1, 2, 3] - } -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mpercolate-5-1]] -=== `mpercolate` - -[source,js] --------- -client.mpercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<> -- The index of the document being count percolated to use as default -`type`:: -<> -- The type of the document being percolated to use as default. -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearch-5-1]] -=== `msearch` - -[source,js] --------- -client.msearch([params, [callback]]) --------- - -Execute several search requests within the same request. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform multiple different searches, the body is made up of meta/data pairs -[source,js] ---------- -const response = await client.msearch({ - body: [ - // match all query, on all indices and types - {}, - { query: { match_all: {} } }, - - // query_string query, on index/mytype - { index: 'myindex', type: 'mytype' }, - { query: { query_string: { query: '"Test 1"' } } } - ] -}); ---------- - - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`maxConcurrentSearches`:: -<> -- Controls the maximum number of concurrent searches the multi search api will execute -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearchtemplate-5-1]] -=== `msearchTemplate` - -[source,js] --------- -client.msearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mtermvectors-5-1]] -=== `mtermvectors` - -[source,js] --------- -client.mtermvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ids`:: -<>, <>, <> -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body -`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". -`[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". -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[positions=true]`:: -<> -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`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". -`routing`:: -<> -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`parent`:: -<> -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`realtime`:: -<> -- Specifies if requests are real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-percolate-5-1]] -=== `percolate` - -[source,js] --------- -client.percolate([params, [callback]]) --------- - -Match a document against registered percolator queries. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -.First, Register queries named “alert-1” and “alert-2” for the “myindex” index -[source,js] ---------- -await Promise.all([ - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-1', - body: { - // This query will be run against documents sent to percolate - query: { - query_string: { - query: 'foo' - } - } - } - }), - - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-2', - body: { - // This query will also be run against documents sent to percolate - query: { - query_string: { - query: 'bar' - } - } - } - }) -]); ---------- - -.Then you can send documents to learn which query `_percolator` queries they match -[source,js] ---------- -const response1 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo" - } - } -}); - -// response1 should look something like -// { -// total: 1, -// matches: [ { _index: 'myindex', _id: 'alert-1' } ] -// } - -const response2 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo Bar" - } - } -}); - -// response2 should look something like -// { -// total: 2, -// matches: [ -// { _index: 'myindex', _id: 'alert-1' }, -// { _index: 'myindex', _id: 'alert-2' } -// ] -// } ---------- - - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to percolate document into. Defaults to type. -`percolateRouting`:: -<> -- The routing value to use when percolating the existing document. -`percolatePreference`:: -<> -- Which shard to prefer when executing the percolate request. -`percolateFormat`:: -<> -- Return an array of matching query IDs instead of objects -Options::: - * `"ids"` - -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being percolated. -`type`:: -<> -- The type of the document being percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ping-5-1]] -=== `ping` - -[source,js] --------- -client.ping([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-putscript-5-1]] -=== `putScript` - -[source,js] --------- -client.putScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-puttemplate-5-1]] -=== `putTemplate` - -[source,js] --------- -client.putTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindex-5-1]] -=== `reindex` - -[source,js] --------- -client.reindex([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`waitForCompletion`:: -<> -- Should the request should block until the reindex is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindexrethrottle-5-1]] -=== `reindexRethrottle` - -[source,js] --------- -client.reindexRethrottle([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`requestsPerSecond`:: -<> -- The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. -`taskId`:: -<> -- The task id to rethrottle -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-rendersearchtemplate-5-1]] -=== `renderSearchTemplate` - -[source,js] --------- -client.renderSearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- The id of the stored search template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-scroll-5-1]] -=== `scroll` - -[source,js] --------- -client.scroll([params, [callback]]) --------- - -Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -.Collect every title in the index that contains the word "test" -[source,js] ---------- -const allTitles = []; -const responseQueue = []; - -// start things off by searching, setting a scroll timeout, and pushing -// our first response into the queue to be processed -await client.search({ - index: 'myindex', - scroll: '30s', // keep the search results "scrollable" for 30 seconds - source: ['title'], // filter the source to only include the title field - q: 'title:test' -}) - -while (responseQueue.length) { - const response = responseQueue.shift(); - - // collect the titles from this response - response.hits.hits.forEach(function (hit) { - allTitles.push(hit.fields.title); - }); - - // check to see if we have collected all of the titles - if (response.hits.total === allTitles.length) { - console.log('every "test" title', allTitles); - break - } - - // get the next response if there are more titles to fetch - responseQueue.push( - await client.scroll({ - scrollId: response._scroll_id, - scroll: '30s' - }) - ); -} ---------- - - - -*Params* - -[horizontal] -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`scrollId`:: -<> -- The scroll ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-search-5-1]] -=== `search` - -[source,js] --------- -client.search([params, [callback]]) --------- - -Return documents matching a query, aggregations/facets, highlighted snippets, suggestions, and more. Write your queries as either http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-uri-request.html[simple query strings] in the `q` parameter, or by specifying a http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html[full request definition] using the http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html[Elasticsearch Query DSL] in the `body` parameter. - -TIP: https://github.com/danpaz/bodybuilder[bodybuilder] and https://github.com/sudo-suhas/elastic-builder[elastic-builder] can be used to make building query bodies easier. - - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Search with a simple query string query -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - q: 'title:test' -}); ---------- - -.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash` -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - body: { - query: { - match: { - title: 'test' - } - }, - facets: { - tags: { - terms: { - field: 'tags' - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return as part of a hit -`docvalueFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`suggestField`:: -<> -- Specify which field to use for suggestions -`[suggestMode=missing]`:: -<> -- Specify suggest mode -Options::: - * `"missing"` - * `"popular"` - * `"always"` - -`suggestSize`:: -<> -- How many suggestions to return in response -`suggestText`:: -<> -- The source text for which the suggestions should be returned -`timeout`:: -<> -- Explicit operation timeout -`trackScores`:: -<> -- Whether to calculate and return scores even if they are not used for sorting -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchshards-5-1]] -=== `searchShards` - -[source,js] --------- -client.searchShards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-shards.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchtemplate-5-1]] -=== `searchTemplate` - -[source,js] --------- -client.searchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`profile`:: -<> -- Specify whether to profile the query execution -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-suggest-5-1]] -=== `suggest` - -[source,js] --------- -client.suggest([params, [callback]]) --------- - -The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-suggesters.html[the elasticsearch docs] for more information pertaining to this method. - -.Return query terms suggestions (“auto-correction”) -[source,js] ---------- -const response = await client.suggest({ - index: 'myindex', - body: { - mysuggester: { - text: 'tset', - term: { - field: 'title' - } - } - } -}); - -// response will be formatted like so: -// -// { -// ... -// mysuggester: [ -// { -// text: "tset", -// ... -// options: [ -// { -// text: "test", -// score: 0.75, -// freq: 5 -// } -// ] -// } -// ] -// } - ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-suggesters.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-termvectors-5-1]] -=== `termvectors` - -[source,js] --------- -client.termvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`termStatistics`:: -<> -- Specifies if total term frequency and document frequency should be returned. -`[fieldStatistics=true]`:: -<> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. -`[positions=true]`:: -<> -- Specifies if term positions should be returned. -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random). -`routing`:: -<> -- Specific routing value. -`parent`:: -<> -- Parent id of documents. -`realtime`:: -<> -- Specifies if request is real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`id`:: -<> -- The id of the document, when not specified a doc param should be supplied. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-update-5-1]] -=== `update` - -[source,js] --------- -client.update([params, [callback]]) --------- - -Update parts of a document. The required body parameter can contain one of two things: - - * a partial document, which will be merged with the existing one. - * a `script` which will update the document content - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-update.html[the elasticsearch docs] for more information pertaining to this method. - -.Update document title using partial document -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - // put the partial document under the `doc` key - doc: { - title: 'Updated' - } - } -}) ---------- - -.Add a tag to document `tags` property using a `script` -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags += tag', - params: { tag: 'some new tag' } - } -}); ---------- - -.Increment a document counter by 1 or initialize it, when the document does not exist -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '777', - body: { - script: 'ctx._source.counter += 1', - upsert: { - counter: 1 - } - } -}) ---------- - -.Delete a document if it's tagged “to-delete” -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"', - params: { - tag: 'to-delete' - } - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<>, <>, <> -- A comma-separated list of fields to return in the response -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`lang`:: -<> -- The script language (default: painless) -`parent`:: -<> -- ID of the parent document. Is is only used for routing and when for the upsert request -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`retryOnConflict`:: -<> -- Specify how many times should the operation be retried when a conflict occurs (default: 0) -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"force"` - -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-update.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-updatebyquery-5-1]] -=== `updateByQuery` - -[source,js] --------- -client.updateByQuery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the update by query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`pipeline`:: -<> -- Ingest pipeline to set on index requests made by this action. (default: none) -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`versionType`:: -<> -- Should the document increment the version number (internal) on hit or not (reindex) -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`waitForCompletion`:: -<> -- Should the request should block until the update by query operation is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cat-aliases-5-1]] -=== `cat.aliases` - -[source,js] --------- -client.cat.aliases([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-cat-allocation-5-1]] -=== `cat.allocation` - -[source,js] --------- -client.cat.allocation([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`nodeId`:: -<>, <>, <> -- A comma-separated list of node IDs or names to limit the returned information - -link:#[back to top] - -[[api-cat-count-5-1]] -=== `cat.count` - -[source,js] --------- -client.cat.count([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-count.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-fielddata-5-1]] -=== `cat.fielddata` - -[source,js] --------- -client.cat.fielddata([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return the fielddata size - -link:#[back to top] - -[[api-cat-health-5-1]] -=== `cat.health` - -[source,js] --------- -client.cat.health([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`[ts=true]`:: -<> -- Set to false to disable timestamping -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-help-5-1]] -=== `cat.help` - -[source,js] --------- -client.cat.help([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by - -link:#[back to top] - -[[api-cat-indices-5-1]] -=== `cat.indices` - -[source,js] --------- -client.cat.indices([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"m"` - * `"g"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`health`:: -<> -- A health status ("green", "yellow", or "red" to filter only indices matching the specified health status -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`help`:: -<> -- Return help information -`pri`:: -<> -- Set to true to return stats only for primary shards -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-master-5-1]] -=== `cat.master` - -[source,js] --------- -client.cat.master([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-master.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodeattrs-5-1]] -=== `cat.nodeattrs` - -[source,js] --------- -client.cat.nodeattrs([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodes-5-1]] -=== `cat.nodes` - -[source,js] --------- -client.cat.nodes([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`fullId`:: -<> -- Return the full node ID instead of the shortened version (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-pendingtasks-5-1]] -=== `cat.pendingTasks` - -[source,js] --------- -client.cat.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-plugins-5-1]] -=== `cat.plugins` - -[source,js] --------- -client.cat.plugins([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-recovery-5-1]] -=== `cat.recovery` - -[source,js] --------- -client.cat.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-repositories-5-1]] -=== `cat.repositories` - -[source,js] --------- -client.cat.repositories([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-segments-5-1]] -=== `cat.segments` - -[source,js] --------- -client.cat.segments([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-shards-5-1]] -=== `cat.shards` - -[source,js] --------- -client.cat.shards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-snapshots-5-1]] -=== `cat.snapshots` - -[source,js] --------- -client.cat.snapshots([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`ignoreUnavailable`:: -<> -- Set to true to ignore unavailable snapshots -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`repository`:: -<>, <>, <> -- Name of repository from which to fetch the snapshot information - -link:#[back to top] - -[[api-cat-tasks-5-1]] -=== `cat.tasks` - -[source,js] --------- -client.cat.tasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id. Set to -1 to return all. -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-templates-5-1]] -=== `cat.templates` - -[source,js] --------- -client.cat.templates([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<> -- A pattern that returned template names must match - -link:#[back to top] - -[[api-cat-threadpool-5-1]] -=== `cat.threadPool` - -[source,js] --------- -client.cat.threadPool([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`size`:: -<> -- The multiplier in which to display values -Options::: - * `""` - * `"k"` - * `"m"` - * `"g"` - * `"t"` - * `"p"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`threadPoolPatterns`:: -<>, <>, <> -- A comma-separated list of regular-expressions to filter the thread pools in the output - -link:#[back to top] - -[[api-cluster-allocationexplain-5-1]] -=== `cluster.allocationExplain` - -[source,js] --------- -client.cluster.allocationExplain([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeYesDecisions`:: -<> -- Return 'YES' decisions in explanation (default: false) -`includeDiskInfo`:: -<> -- Return information about disk usage and shard sizes (default: false) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-getsettings-5-1]] -=== `cluster.getSettings` - -[source,js] --------- -client.cluster.getSettings([params, [callback]]) --------- - -Get cluster settings (previously set with `putSettings()`) - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`includeDefaults`:: -<> -- Whether to return all default clusters setting. - -link:#[back to top] - -[[api-cluster-health-5-1]] -=== `cluster.health` - -[source,js] --------- -client.cluster.health([params, [callback]]) --------- - -Get a very simple status on the health of the cluster. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`[level=cluster]`:: -<> -- Specify the level of detail for returned information -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`waitForActiveShards`:: -<> -- Wait until the specified number of shards is active -`waitForNodes`:: -<> -- Wait until the specified number of nodes is available -`waitForEvents`:: -<> -- Wait until all currently queued events with the given priority are processed -Options::: - * `"immediate"` - * `"urgent"` - * `"high"` - * `"normal"` - * `"low"` - * `"languid"` - -`waitForNoRelocatingShards`:: -<> -- Whether to wait until there are no relocating shards in the cluster -`waitForStatus`:: -<> -- Wait until cluster is in a specific state -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`index`:: -<>, <>, <> -- Limit the information returned to a specific index - -link:#[back to top] - -[[api-cluster-pendingtasks-5-1]] -=== `cluster.pendingTasks` - -[source,js] --------- -client.cluster.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master - -link:#[back to top] - -[[api-cluster-putsettings-5-1]] -=== `cluster.putSettings` - -[source,js] --------- -client.cluster.putSettings([params, [callback]]) --------- - -Update cluster wide specific settings. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-reroute-5-1]] -=== `cluster.reroute` - -[source,js] --------- -client.cluster.reroute([params, [callback]]) --------- - -Explicitly execute a cluster reroute allocation command including specific commands. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`dryRun`:: -<> -- Simulate the operation only and return the resulting state -`explain`:: -<> -- Return an explanation of why the commands can or cannot be executed -`retryFailed`:: -<> -- Retries allocation of shards that are blocked due to too many subsequent allocation failures -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics. Defaults to all but metadata -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-state-5-1]] -=== `cluster.state` - -[source,js] --------- -client.cluster.state([params, [callback]]) --------- - -Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics - -link:#[back to top] - -[[api-cluster-stats-5-1]] -=== `cluster.stats` - -[source,js] --------- -client.cluster.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-indices-analyze-5-1]] -=== `indices.analyze` - -[source,js] --------- -client.indices.analyze([params, [callback]]) --------- - -Perform the analysis process on a text and return the tokens breakdown of the text. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The name of the analyzer to use -`charFilter`:: -<>, <>, <> -- A comma-separated list of character filters to use for the analysis -`field`:: -<> -- Use the analyzer configured for this field (instead of passing the analyzer name) -`filter`:: -<>, <>, <> -- A comma-separated list of filters to use for the analysis -`index`:: -<> -- The name of the index to scope the operation -`preferLocal`:: -<> -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) -`text`:: -<>, <>, <> -- The text on which the analysis should be performed (when request body is not used) -`tokenizer`:: -<> -- The name of the tokenizer to use for the analysis -`explain`:: -<> -- With `true`, outputs more advanced details. (default: false) -`attributes`:: -<>, <>, <> -- A comma-separated list of token attributes to output, this parameter works only with `explain=true` -`[format=detailed]`:: -<> -- Format of the output -Options::: - * `"detailed"` - * `"text"` - -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-clearcache-5-1]] -=== `indices.clearCache` - -[source,js] --------- -client.indices.clearCache([params, [callback]]) --------- - -Clear either all caches or specific cached associated with one ore more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fieldData`:: -<> -- Clear field data -`fielddata`:: -<> -- Clear field data -`fields`:: -<>, <>, <> -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all) -`query`:: -<> -- Clear query caches -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index name to limit the operation -`recycler`:: -<> -- Clear the recycler cache -`request`:: -<> -- Clear request cache -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-close-5-1]] -=== `indices.close` - -[source,js] --------- -client.indices.close([params, [callback]]) --------- - -Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to close -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-create-5-1]] -=== `indices.create` - -[source,js] --------- -client.indices.create([params, [callback]]) --------- - -Create an index in Elasticsearch. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for before the operation returns. -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`index`:: -<> -- The name of the index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-delete-5-1]] -=== `indices.delete` - -[source,js] --------- -client.indices.delete([params, [callback]]) --------- - -Delete an index in Elasticsearch - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletealias-5-1]] -=== `indices.deleteAlias` - -[source,js] --------- -client.indices.deleteAlias([params, [callback]]) --------- - -Delete a specific alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names (supports wildcards); use `_all` for all indices -`name`:: -<>, <>, <> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletetemplate-5-1]] -=== `indices.deleteTemplate` - -[source,js] --------- -client.indices.deleteTemplate([params, [callback]]) --------- - -Delete an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-exists-5-1]] -=== `indices.exists` - -[source,js] --------- -client.indices.exists([params, [callback]]) --------- - -Return a boolean indicating whether given index exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of indices to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existsalias-5-1]] -=== `indices.existsAlias` - -[source,js] --------- -client.indices.existsAlias([params, [callback]]) --------- - -Return a boolean indicating whether given alias exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstemplate-5-1]] -=== `indices.existsTemplate` - -[source,js] --------- -client.indices.existsTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstype-5-1]] -=== `indices.existsType` - -[source,js] --------- -client.indices.existsType([params, [callback]]) --------- - -Check if a type/types exists in an index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` to check the types across all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flush-5-1]] -=== `indices.flush` - -[source,js] --------- -client.indices.flush([params, [callback]]) --------- - -Explicitly flush one or more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`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. -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flushsynced-5-1]] -=== `indices.flushSynced` - -[source,js] --------- -client.indices.flushSynced([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-forcemerge-5-1]] -=== `indices.forcemerge` - -[source,js] --------- -client.indices.forcemerge([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flush`:: -<> -- Specify whether the index should be flushed after performing the operation (default: true) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`maxNumSegments`:: -<> -- The number of segments the index should be merged into (default: dynamic) -`onlyExpungeDeletes`:: -<> -- Specify whether the operation should only expunge deleted documents -`operationThreading`:: -anything -- TODO: ? -`waitForMerge`:: -<> -- Specify whether the request should block until the merge process is finished (default: true) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-get-5-1]] -=== `indices.get` - -[source,js] --------- -client.indices.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Ignore unavailable indexes (default: false) -`allowNoIndices`:: -<> -- Ignore if a wildcard expression resolves to no concrete indices (default: false) -`[expandWildcards=open]`:: -<> -- Whether wildcard expressions should get expanded to open or closed indices (default: open) -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return version and creation date values in human-readable format. -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names -`feature`:: -<>, <>, <> -- A comma-separated list of features - -link:#[back to top] - -[[api-indices-getalias-5-1]] -=== `indices.getAlias` - -[source,js] --------- -client.indices.getAlias([params, [callback]]) --------- - -Retrieve a specified alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=all]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-indices-getfieldmapping-5-1]] -=== `indices.getFieldMapping` - -[source,js] --------- -client.indices.getFieldMapping([params, [callback]]) --------- - -Retrieve mapping definition of a specific field. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeDefaults`:: -<> -- Whether the default mapping values should be returned as well -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types -`fields`:: -<>, <>, <> -- A comma-separated list of fields - -link:#[back to top] - -[[api-indices-getmapping-5-1]] -=== `indices.getMapping` - -[source,js] --------- -client.indices.getMapping([params, [callback]]) --------- - -Retrieve mapping definition of index or index/type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types - -link:#[back to top] - -[[api-indices-getsettings-5-1]] -=== `indices.getSettings` - -[source,js] --------- -client.indices.getSettings([params, [callback]]) --------- - -Retrieve settings for one or more (or all) indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`human`:: -<> -- Whether to return version and creation date values in human-readable format. -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`name`:: -<>, <>, <> -- The name of the settings that should be included - -link:#[back to top] - -[[api-indices-gettemplate-5-1]] -=== `indices.getTemplate` - -[source,js] --------- -client.indices.getTemplate([params, [callback]]) --------- - -Retrieve an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<>, <>, <> -- The comma separated names of the index templates - -link:#[back to top] - -[[api-indices-getupgrade-5-1]] -=== `indices.getUpgrade` - -[source,js] --------- -client.indices.getUpgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-open-5-1]] -=== `indices.open` - -[source,js] --------- -client.indices.open([params, [callback]]) --------- - -Open a closed index, making it available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to open -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putalias-5-1]] -=== `indices.putAlias` - -[source,js] --------- -client.indices.putAlias([params, [callback]]) --------- - -Create an alias for a specific index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -`name`:: -<> -- The name of the alias to be created or updated -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putmapping-5-1]] -=== `indices.putMapping` - -[source,js] --------- -client.indices.putMapping([params, [callback]]) --------- - -Register specific mapping definition for a specific type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`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. -`type`:: -<> -- The name of the document type -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putsettings-5-1]] -=== `indices.putSettings` - -[source,js] --------- -client.indices.putSettings([params, [callback]]) --------- - -Change specific index level settings in real time. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Specify timeout for connection to master -`preserveExisting`:: -<> -- Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-puttemplate-5-1]] -=== `indices.putTemplate` - -[source,js] --------- -client.indices.putTemplate([params, [callback]]) --------- - -Create an index template that will automatically be applied to new indices created. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`order`:: -<> -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) -`create`:: -<> -- Whether the index template should only be added if new or can also replace an existing one -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-recovery-5-1]] -=== `indices.recovery` - -[source,js] --------- -client.indices.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`detailed`:: -<> -- Whether to display detailed information about shard recovery -`activeOnly`:: -<> -- Display only those recoveries that are currently on-going -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`index`:: -<>, <>, <> -- 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-5-1]] -=== `indices.refresh` - -[source,js] --------- -client.indices.refresh([params, [callback]]) --------- - -Explicitly refresh one or more index, making all operations performed since the last refresh available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-rollover-5-1]] -=== `indices.rollover` - -[source,js] --------- -client.indices.rollover([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`dryRun`:: -<> -- If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the newly created rollover index before the operation returns. -`alias`:: -<> -- The name of the alias to rollover -`newIndex`:: -<> -- The name of the rollover index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-segments-5-1]] -=== `indices.segments` - -[source,js] --------- -client.indices.segments([params, [callback]]) --------- - -Retrieve low level segments information that a Lucene index (shard level) is built with. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`operationThreading`:: -anything -- TODO: ? -`verbose`:: -<> -- Includes detailed memory usage by Lucene. -`index`:: -<>, <>, <> -- 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-5-1]] -=== `indices.shardStores` - -[source,js] --------- -client.indices.shardStores([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`status`:: -<>, <>, <> -- A comma-separated list of statuses used to filter on shards to get store information for -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-shrink-5-1]] -=== `indices.shrink` - -[source,js] --------- -client.indices.shrink([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the shrunken index before the operation returns. -`index`:: -<> -- The name of the source index to shrink -`target`:: -<> -- The name of the target index to shrink into -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-stats-5-1]] -=== `indices.stats` - -[source,js] --------- -client.indices.stats([params, [callback]]) --------- - -Retrieve statistics on different operations happening on an index. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<>, <>, <> -- A comma-separated list of search groups for `search` index metric -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`[level=indices]`:: -<> -- Return stats aggregated at cluster, index or shard level -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned the specific metrics. - -link:#[back to top] - -[[api-indices-updatealiases-5-1]] -=== `indices.updateAliases` - -[source,js] --------- -client.indices.updateAliases([params, [callback]]) --------- - -Update specified aliases. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform an atomic alias swap, for a rotating index -[source,js] ---------- -const response = await client.indices.updateAliases({ - body: { - actions: [ - { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } }, - { add: { index: 'logstash-2014.05', alias: 'logstash-current' } } - ] - } -}); ---------- - - - -*Params* - -[horizontal] -`timeout`:: -<> -- Request timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-upgrade-5-1]] -=== `indices.upgrade` - -[source,js] --------- -client.indices.upgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`waitForCompletion`:: -<> -- Specify whether the request should block until the all segments are upgraded (default: false) -`onlyAncientSegments`:: -<> -- If true, only ancient (an older Lucene major release) segments will be upgraded -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-validatequery-5-1]] -=== `indices.validateQuery` - -[source,js] --------- -client.indices.validateQuery([params, [callback]]) --------- - -Validate a potentially expensive query without executing it. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-validate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`explain`:: -<> -- Return detailed information about the error -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`rewrite`:: -<> -- Provide a more detailed explanation showing the actual Lucene query that will be executed. -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-validate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-deletepipeline-5-1]] -=== `ingest.deletePipeline` - -[source,js] --------- -client.ingest.deletePipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-getpipeline-5-1]] -=== `ingest.getPipeline` - -[source,js] --------- -client.ingest.getPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`id`:: -<> -- Comma separated list of pipeline ids. Wildcards supported - -link:#[back to top] - -[[api-ingest-putpipeline-5-1]] -=== `ingest.putPipeline` - -[source,js] --------- -client.ingest.putPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-simulate-5-1]] -=== `ingest.simulate` - -[source,js] --------- -client.ingest.simulate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`verbose`:: -<> -- Verbose mode. Display data output for each processor in executed pipeline -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-nodes-hotthreads-5-1]] -=== `nodes.hotThreads` - -[source,js] --------- -client.nodes.hotThreads([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`interval`:: -<> -- The interval for the second sampling of threads -`snapshots`:: -<> -- Number of samples of thread stacktrace (default: 10) -`threads`:: -<> -- Specify the number of threads to provide information for (default: 3) -`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) -`type`:: -<> -- The type to sample (default: cpu) -Options::: - * `"cpu"` - * `"wait"` - * `"block"` - -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-nodes-info-5-1]] -=== `nodes.info` - -[source,js] --------- -client.nodes.info([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`timeout`:: -<> -- Explicit operation timeout -`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 -`metric`:: -<>, <>, <> -- A comma-separated list of metrics you wish returned. Leave empty to return all. - -link:#[back to top] - -[[api-nodes-stats-5-1]] -=== `nodes.stats` - -[source,js] --------- -client.nodes.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<> -- A comma-separated list of search groups for `search` index metric -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`[level=node]`:: -<> -- Return indices stats aggregated at index, node or shard level -Options::: - * `"indices"` - * `"node"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`timeout`:: -<> -- Explicit operation timeout -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics -`indexMetric`:: -<>, <>, <> -- Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. -`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 - -link:#[back to top] - -[[api-snapshot-create-5-1]] -=== `snapshot.create` - -[source,js] --------- -client.snapshot.create([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-createrepository-5-1]] -=== `snapshot.createRepository` - -[source,js] --------- -client.snapshot.createRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`verify`:: -<> -- Whether to verify the repository after creation -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-delete-5-1]] -=== `snapshot.delete` - -[source,js] --------- -client.snapshot.delete([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-deleterepository-5-1]] -=== `snapshot.deleteRepository` - -[source,js] --------- -client.snapshot.deleteRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<>, <>, <> -- A comma-separated list of repository names -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-get-5-1]] -=== `snapshot.get` - -[source,js] --------- -client.snapshot.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-getrepository-5-1]] -=== `snapshot.getRepository` - -[source,js] --------- -client.snapshot.getRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`repository`:: -<>, <>, <> -- A comma-separated list of repository names - -link:#[back to top] - -[[api-snapshot-restore-5-1]] -=== `snapshot.restore` - -[source,js] --------- -client.snapshot.restore([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-status-5-1]] -=== `snapshot.status` - -[source,js] --------- -client.snapshot.status([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-verifyrepository-5-1]] -=== `snapshot.verifyRepository` - -[source,js] --------- -client.snapshot.verifyRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-cancel-5-1]] -=== `tasks.cancel` - -[source,js] --------- -client.tasks.cancel([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all. -`parentNode`:: -<> -- Cancel tasks with specified parent node. -`parentTask`:: -<> -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. -`taskId`:: -<> -- Cancel the task with specified task id (node_id:task_number) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-get-5-1]] -=== `tasks.get` - -[source,js] --------- -client.tasks.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`taskId`:: -<> -- Return the task with specified id (node_id:task_number) - -link:#[back to top] - -[[api-tasks-list-5-1]] -=== `tasks.list` - -[source,js] --------- -client.tasks.list([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`[groupBy=nodes]`:: -<> -- Group tasks by nodes or parent/child relationships -Options::: - * `"nodes"` - * `"parents"` - - -link:#[back to top] diff --git a/docs/api_methods_5_2.asciidoc b/docs/api_methods_5_2.asciidoc deleted file mode 100644 index 8870ec552..000000000 --- a/docs/api_methods_5_2.asciidoc +++ /dev/null @@ -1,5335 +0,0 @@ -[[api-reference-5-2]] -== 5.2 API - - -NOTE: At this time, you must opt into the 5.2 API by setting the `apiVersion` config parameter. - - -[[api-bulk-5-2]] -=== `bulk` - -[source,js] --------- -client.bulk([params, [callback]]) --------- - -Perform many index/delete operations in a single API call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform three operations in a single request -[source,js] ---------- -client.bulk({ - body: [ - // action description - { index: { _index: 'myindex', _type: 'mytype', _id: 1 } }, - // the document to index - { title: 'foo' }, - // action description - { update: { _index: 'myindex', _type: 'mytype', _id: 2 } }, - // the document to update - { doc: { title: 'foo' } }, - // action description - { delete: { _index: 'myindex', _type: 'mytype', _id: 3 } }, - // no document needed for this delete - ] -}, function (err, resp) { - // ... -}); ---------- - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- 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`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`type`:: -<> -- Default document type for items which don't provide one -`fields`:: -<>, <>, <> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request -`_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 -`_sourceExclude`:: -<>, <>, <> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -`_sourceInclude`:: -<>, <>, <> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`index`:: -<> -- Default index for items which don't provide one -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-clearscroll-5-2]] -=== `clearScroll` - -[source,js] --------- -client.clearScroll([params, [callback]]) --------- - -Clear the scroll request created by specifying the scroll parameter to search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`scrollId`:: -<>, <>, <> -- A comma-separated list of scroll IDs to clear -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-count-5-2]] -=== `count` - -[source,js] --------- -client.count([params, [callback]]) --------- - -Get the number of documents for the cluster, index, type, or a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-count.html[the elasticsearch docs] for more information pertaining to this method. - -.Get the number of all documents in the cluster -[source,js] ---------- -const { count } = await client.count(); ---------- - -.Get the number of documents in an index -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name' -}); ---------- - -.Get the number of documents matching a query -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name', - body: { - query: { - filtered: { - filter: { - terms: { - foo: ['bar'] - } - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`minScore`:: -<> -- Include only documents with a specific `_score` value in the result -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`index`:: -<>, <>, <> -- A comma-separated list of indices to restrict the results -`type`:: -<>, <>, <> -- A comma-separated list of types to restrict the results -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-count.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-countpercolate-5-2]] -=== `countPercolate` - -[source,js] --------- -client.countPercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to count percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to count percolate document into. Defaults to type. -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being count percolated. -`type`:: -<> -- The type of the document being count percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-create-5-2]] -=== `create` - -[source,js] --------- -client.create([params, [callback]]) --------- - -Adds a typed JSON document in a specific index, making it searchable. If a document with the same `index`, `type`, and `id` already exists, an error will occur. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create a document -[source,js] ---------- -await client.create({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - published_at: '2013-01-01', - counter: 1 - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-delete-5-2]] -=== `delete` - -[source,js] --------- -client.delete([params, [callback]]) --------- - -Delete a typed JSON document from a specific index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. - -.Delete the document `/myindex/mytype/1` -[source,js] ---------- -await client.delete({ - index: 'myindex', - type: 'mytype', - id: '1' -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-delete.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletebyquery-5-2]] -=== `deleteByQuery` - -[source,js] --------- -client.deleteByQuery([params, [callback]]) --------- - -Delete documents from one or more indices and one or more types based on a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -.Deleting documents with a simple query -[source,js] ---------- -await client.deleteByQuery({ - index: 'myindex', - q: 'test' -}); ---------- - -.Deleting documents using the Query DSL -[source,js] ---------- -await client.deleteByQuery({ - index: 'posts', - body: { - query: { - term: { published: false } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the delete-by-query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`waitForCompletion`:: -<> -- Should the request should block until the delete-by-query is complete. -`requestsPerSecond`:: -<> -- The throttle for this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletescript-5-2]] -=== `deleteScript` - -[source,js] --------- -client.deleteScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletetemplate-5-2]] -=== `deleteTemplate` - -[source,js] --------- -client.deleteTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-exists-5-2]] -=== `exists` - -[source,js] --------- -client.exists([params, [callback]]) --------- - -Returns a boolean indicating whether or not a given document exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Check that the document `/myindex/mytype/1` exist -[source,js] ---------- -const exists = await client.exists({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-explain-5-2]] -=== `explain` - -[source,js] --------- -client.explain([params, [callback]]) --------- - -Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-explain.html[the elasticsearch docs] for more information pertaining to this method. - -.See how a document is scored against a simple query -[source,js] ---------- -const response = await client.explain({ - // the document to test - index: 'myindex', - type: 'mytype', - id: '1', - - // the query to score it against - q: 'field:value' -}); ---------- - -.See how a document is scored against a query written in the Query DSL -[source,js] ---------- -const response = await client.explain({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - query: { - match: { title: 'test' } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzeWildcard`:: -<> -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -`analyzer`:: -<> -- The analyzer for the query string query -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The default field for query string query (default: _all) -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-fieldstats-5-2]] -=== `fieldStats` - -[source,js] --------- -client.fieldStats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-field-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fields`:: -<>, <>, <> -- A comma-separated list of fields for to get field statistics for (min value, max value, and more) -`[level=cluster]`:: -<> -- Defines if field stats should be returned on a per index level or on a cluster wide level -Options::: - * `"indices"` - * `"cluster"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-field-stats.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-get-5-2]] -=== `get` - -[source,js] --------- -client.get([params, [callback]]) --------- - -Get a typed JSON document from the index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Get `/myindex/mytype/1` -[source,js] ---------- -const response = await client.get({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) - -link:#[back to top] - -[[api-getscript-5-2]] -=== `getScript` - -[source,js] --------- -client.getScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language - -link:#[back to top] - -[[api-getsource-5-2]] -=== `getSource` - -[source,js] --------- -client.getSource([params, [callback]]) --------- - -Get the source of a document by its index, type and id. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document; use `_all` to fetch the first document matching the ID across all types - -link:#[back to top] - -[[api-gettemplate-5-2]] -=== `getTemplate` - -[source,js] --------- -client.getTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID - -link:#[back to top] - -[[api-index-5-2]] -=== `index` - -[source,js] --------- -client.index([params, [callback]]) --------- - -Stores a typed JSON document in an index, making it searchable. When the `id` param is not set, a unique id will be auto-generated. When you specify an `id` either a new document will be created, or an existing document will be updated. To enforce "put-if-absent" behavior set the `opType` to `"create"` or use the `create()` method. - -Optimistic concurrency control is performed, when the `version` argument is specified. By default, no version checks are performed. - -By default, the document will be available for `get()` actions immediately, but will only be available for searching after an index refresh (which can happen automatically or manually). See <>. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create or update a document -[source,js] ---------- -const response = await client.index({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -`[opType=index]`:: -<> -- Explicit operation type -Options::: - * `"index"` - * `"create"` - -`parent`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-info-5-2]] -=== `info` - -[source,js] --------- -client.info([params, [callback]]) --------- - -Get basic info from the current cluster. - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-mget-5-2]] -=== `mget` - -[source,js] --------- -client.mget([params, [callback]]) --------- - -Get multiple documents based on an index, type (optional) and ids. The body required by mget can take two forms: an array of document locations, or an array of document ids. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. - -.An array of doc locations. Useful for getting documents from different indices. -[source,js] ---------- -const response = await client.mget({ - body: { - docs: [ - { _index: 'indexA', _type: 'typeA', _id: '1' }, - { _index: 'indexB', _type: 'typeB', _id: '1' }, - { _index: 'indexC', _type: 'typeC', _id: '1' } - ] - } -}); ---------- - -.An array of ids. You must also specify the `index` and `type` that apply to all of the ids. -[source,js] ---------- -const response = await client.mget({ - index: 'myindex', - type: 'mytype', - body: { - ids: [1, 2, 3] - } -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mpercolate-5-2]] -=== `mpercolate` - -[source,js] --------- -client.mpercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<> -- The index of the document being count percolated to use as default -`type`:: -<> -- The type of the document being percolated to use as default. -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearch-5-2]] -=== `msearch` - -[source,js] --------- -client.msearch([params, [callback]]) --------- - -Execute several search requests within the same request. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform multiple different searches, the body is made up of meta/data pairs -[source,js] ---------- -const response = await client.msearch({ - body: [ - // match all query, on all indices and types - {}, - { query: { match_all: {} } }, - - // query_string query, on index/mytype - { index: 'myindex', type: 'mytype' }, - { query: { query_string: { query: '"Test 1"' } } } - ] -}); ---------- - - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`maxConcurrentSearches`:: -<> -- Controls the maximum number of concurrent searches the multi search api will execute -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearchtemplate-5-2]] -=== `msearchTemplate` - -[source,js] --------- -client.msearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mtermvectors-5-2]] -=== `mtermvectors` - -[source,js] --------- -client.mtermvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ids`:: -<>, <>, <> -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body -`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". -`[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". -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[positions=true]`:: -<> -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`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". -`routing`:: -<> -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`parent`:: -<> -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`realtime`:: -<> -- Specifies if requests are real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-percolate-5-2]] -=== `percolate` - -[source,js] --------- -client.percolate([params, [callback]]) --------- - -Match a document against registered percolator queries. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -.First, Register queries named “alert-1” and “alert-2” for the “myindex” index -[source,js] ---------- -await Promise.all([ - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-1', - body: { - // This query will be run against documents sent to percolate - query: { - query_string: { - query: 'foo' - } - } - } - }), - - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-2', - body: { - // This query will also be run against documents sent to percolate - query: { - query_string: { - query: 'bar' - } - } - } - }) -]); ---------- - -.Then you can send documents to learn which query `_percolator` queries they match -[source,js] ---------- -const response1 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo" - } - } -}); - -// response1 should look something like -// { -// total: 1, -// matches: [ { _index: 'myindex', _id: 'alert-1' } ] -// } - -const response2 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo Bar" - } - } -}); - -// response2 should look something like -// { -// total: 2, -// matches: [ -// { _index: 'myindex', _id: 'alert-1' }, -// { _index: 'myindex', _id: 'alert-2' } -// ] -// } ---------- - - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to percolate document into. Defaults to type. -`percolateRouting`:: -<> -- The routing value to use when percolating the existing document. -`percolatePreference`:: -<> -- Which shard to prefer when executing the percolate request. -`percolateFormat`:: -<> -- Return an array of matching query IDs instead of objects -Options::: - * `"ids"` - -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being percolated. -`type`:: -<> -- The type of the document being percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ping-5-2]] -=== `ping` - -[source,js] --------- -client.ping([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-putscript-5-2]] -=== `putScript` - -[source,js] --------- -client.putScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-puttemplate-5-2]] -=== `putTemplate` - -[source,js] --------- -client.putTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindex-5-2]] -=== `reindex` - -[source,js] --------- -client.reindex([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`waitForCompletion`:: -<> -- Should the request should block until the reindex is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindexrethrottle-5-2]] -=== `reindexRethrottle` - -[source,js] --------- -client.reindexRethrottle([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`requestsPerSecond`:: -<> -- The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. -`taskId`:: -<> -- The task id to rethrottle -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-rendersearchtemplate-5-2]] -=== `renderSearchTemplate` - -[source,js] --------- -client.renderSearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- The id of the stored search template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-scroll-5-2]] -=== `scroll` - -[source,js] --------- -client.scroll([params, [callback]]) --------- - -Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -.Collect every title in the index that contains the word "test" -[source,js] ---------- -const allTitles = []; -const responseQueue = []; - -// start things off by searching, setting a scroll timeout, and pushing -// our first response into the queue to be processed -await client.search({ - index: 'myindex', - scroll: '30s', // keep the search results "scrollable" for 30 seconds - source: ['title'], // filter the source to only include the title field - q: 'title:test' -}) - -while (responseQueue.length) { - const response = responseQueue.shift(); - - // collect the titles from this response - response.hits.hits.forEach(function (hit) { - allTitles.push(hit.fields.title); - }); - - // check to see if we have collected all of the titles - if (response.hits.total === allTitles.length) { - console.log('every "test" title', allTitles); - break - } - - // get the next response if there are more titles to fetch - responseQueue.push( - await client.scroll({ - scrollId: response._scroll_id, - scroll: '30s' - }) - ); -} ---------- - - - -*Params* - -[horizontal] -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`scrollId`:: -<> -- The scroll ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-search-5-2]] -=== `search` - -[source,js] --------- -client.search([params, [callback]]) --------- - -Return documents matching a query, aggregations/facets, highlighted snippets, suggestions, and more. Write your queries as either http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-uri-request.html[simple query strings] in the `q` parameter, or by specifying a http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html[full request definition] using the http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html[Elasticsearch Query DSL] in the `body` parameter. - -TIP: https://github.com/danpaz/bodybuilder[bodybuilder] and https://github.com/sudo-suhas/elastic-builder[elastic-builder] can be used to make building query bodies easier. - - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Search with a simple query string query -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - q: 'title:test' -}); ---------- - -.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash` -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - body: { - query: { - match: { - title: 'test' - } - }, - facets: { - tags: { - terms: { - field: 'tags' - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return as part of a hit -`docvalueFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`suggestField`:: -<> -- Specify which field to use for suggestions -`[suggestMode=missing]`:: -<> -- Specify suggest mode -Options::: - * `"missing"` - * `"popular"` - * `"always"` - -`suggestSize`:: -<> -- How many suggestions to return in response -`suggestText`:: -<> -- The source text for which the suggestions should be returned -`timeout`:: -<> -- Explicit operation timeout -`trackScores`:: -<> -- Whether to calculate and return scores even if they are not used for sorting -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchshards-5-2]] -=== `searchShards` - -[source,js] --------- -client.searchShards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-shards.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchtemplate-5-2]] -=== `searchTemplate` - -[source,js] --------- -client.searchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`profile`:: -<> -- Specify whether to profile the query execution -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-suggest-5-2]] -=== `suggest` - -[source,js] --------- -client.suggest([params, [callback]]) --------- - -The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-suggesters.html[the elasticsearch docs] for more information pertaining to this method. - -.Return query terms suggestions (“auto-correction”) -[source,js] ---------- -const response = await client.suggest({ - index: 'myindex', - body: { - mysuggester: { - text: 'tset', - term: { - field: 'title' - } - } - } -}); - -// response will be formatted like so: -// -// { -// ... -// mysuggester: [ -// { -// text: "tset", -// ... -// options: [ -// { -// text: "test", -// score: 0.75, -// freq: 5 -// } -// ] -// } -// ] -// } - ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-suggesters.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-termvectors-5-2]] -=== `termvectors` - -[source,js] --------- -client.termvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`termStatistics`:: -<> -- Specifies if total term frequency and document frequency should be returned. -`[fieldStatistics=true]`:: -<> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. -`[positions=true]`:: -<> -- Specifies if term positions should be returned. -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random). -`routing`:: -<> -- Specific routing value. -`parent`:: -<> -- Parent id of documents. -`realtime`:: -<> -- Specifies if request is real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`id`:: -<> -- The id of the document, when not specified a doc param should be supplied. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-update-5-2]] -=== `update` - -[source,js] --------- -client.update([params, [callback]]) --------- - -Update parts of a document. The required body parameter can contain one of two things: - - * a partial document, which will be merged with the existing one. - * a `script` which will update the document content - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-update.html[the elasticsearch docs] for more information pertaining to this method. - -.Update document title using partial document -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - // put the partial document under the `doc` key - doc: { - title: 'Updated' - } - } -}) ---------- - -.Add a tag to document `tags` property using a `script` -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags += tag', - params: { tag: 'some new tag' } - } -}); ---------- - -.Increment a document counter by 1 or initialize it, when the document does not exist -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '777', - body: { - script: 'ctx._source.counter += 1', - upsert: { - counter: 1 - } - } -}) ---------- - -.Delete a document if it's tagged “to-delete” -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"', - params: { - tag: 'to-delete' - } - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<>, <>, <> -- A comma-separated list of fields to return in the response -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`lang`:: -<> -- The script language (default: painless) -`parent`:: -<> -- ID of the parent document. Is is only used for routing and when for the upsert request -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`retryOnConflict`:: -<> -- Specify how many times should the operation be retried when a conflict occurs (default: 0) -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"force"` - -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-update.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-updatebyquery-5-2]] -=== `updateByQuery` - -[source,js] --------- -client.updateByQuery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the update by query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`pipeline`:: -<> -- Ingest pipeline to set on index requests made by this action. (default: none) -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`versionType`:: -<> -- Should the document increment the version number (internal) on hit or not (reindex) -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`waitForCompletion`:: -<> -- Should the request should block until the update by query operation is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cat-aliases-5-2]] -=== `cat.aliases` - -[source,js] --------- -client.cat.aliases([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-cat-allocation-5-2]] -=== `cat.allocation` - -[source,js] --------- -client.cat.allocation([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`nodeId`:: -<>, <>, <> -- A comma-separated list of node IDs or names to limit the returned information - -link:#[back to top] - -[[api-cat-count-5-2]] -=== `cat.count` - -[source,js] --------- -client.cat.count([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-count.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-fielddata-5-2]] -=== `cat.fielddata` - -[source,js] --------- -client.cat.fielddata([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return the fielddata size - -link:#[back to top] - -[[api-cat-health-5-2]] -=== `cat.health` - -[source,js] --------- -client.cat.health([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`[ts=true]`:: -<> -- Set to false to disable timestamping -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-help-5-2]] -=== `cat.help` - -[source,js] --------- -client.cat.help([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by - -link:#[back to top] - -[[api-cat-indices-5-2]] -=== `cat.indices` - -[source,js] --------- -client.cat.indices([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"m"` - * `"g"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`health`:: -<> -- A health status ("green", "yellow", or "red" to filter only indices matching the specified health status -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`help`:: -<> -- Return help information -`pri`:: -<> -- Set to true to return stats only for primary shards -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-master-5-2]] -=== `cat.master` - -[source,js] --------- -client.cat.master([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-master.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodeattrs-5-2]] -=== `cat.nodeattrs` - -[source,js] --------- -client.cat.nodeattrs([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodes-5-2]] -=== `cat.nodes` - -[source,js] --------- -client.cat.nodes([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`fullId`:: -<> -- Return the full node ID instead of the shortened version (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-pendingtasks-5-2]] -=== `cat.pendingTasks` - -[source,js] --------- -client.cat.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-plugins-5-2]] -=== `cat.plugins` - -[source,js] --------- -client.cat.plugins([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-recovery-5-2]] -=== `cat.recovery` - -[source,js] --------- -client.cat.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-repositories-5-2]] -=== `cat.repositories` - -[source,js] --------- -client.cat.repositories([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-segments-5-2]] -=== `cat.segments` - -[source,js] --------- -client.cat.segments([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-shards-5-2]] -=== `cat.shards` - -[source,js] --------- -client.cat.shards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-snapshots-5-2]] -=== `cat.snapshots` - -[source,js] --------- -client.cat.snapshots([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`ignoreUnavailable`:: -<> -- Set to true to ignore unavailable snapshots -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`repository`:: -<>, <>, <> -- Name of repository from which to fetch the snapshot information - -link:#[back to top] - -[[api-cat-tasks-5-2]] -=== `cat.tasks` - -[source,js] --------- -client.cat.tasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id. Set to -1 to return all. -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-templates-5-2]] -=== `cat.templates` - -[source,js] --------- -client.cat.templates([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<> -- A pattern that returned template names must match - -link:#[back to top] - -[[api-cat-threadpool-5-2]] -=== `cat.threadPool` - -[source,js] --------- -client.cat.threadPool([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`size`:: -<> -- The multiplier in which to display values -Options::: - * `""` - * `"k"` - * `"m"` - * `"g"` - * `"t"` - * `"p"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`threadPoolPatterns`:: -<>, <>, <> -- A comma-separated list of regular-expressions to filter the thread pools in the output - -link:#[back to top] - -[[api-cluster-allocationexplain-5-2]] -=== `cluster.allocationExplain` - -[source,js] --------- -client.cluster.allocationExplain([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeYesDecisions`:: -<> -- Return 'YES' decisions in explanation (default: false) -`includeDiskInfo`:: -<> -- Return information about disk usage and shard sizes (default: false) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-getsettings-5-2]] -=== `cluster.getSettings` - -[source,js] --------- -client.cluster.getSettings([params, [callback]]) --------- - -Get cluster settings (previously set with `putSettings()`) - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`includeDefaults`:: -<> -- Whether to return all default clusters setting. - -link:#[back to top] - -[[api-cluster-health-5-2]] -=== `cluster.health` - -[source,js] --------- -client.cluster.health([params, [callback]]) --------- - -Get a very simple status on the health of the cluster. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`[level=cluster]`:: -<> -- Specify the level of detail for returned information -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`waitForActiveShards`:: -<> -- Wait until the specified number of shards is active -`waitForNodes`:: -<> -- Wait until the specified number of nodes is available -`waitForEvents`:: -<> -- Wait until all currently queued events with the given priority are processed -Options::: - * `"immediate"` - * `"urgent"` - * `"high"` - * `"normal"` - * `"low"` - * `"languid"` - -`waitForNoRelocatingShards`:: -<> -- Whether to wait until there are no relocating shards in the cluster -`waitForStatus`:: -<> -- Wait until cluster is in a specific state -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`index`:: -<>, <>, <> -- Limit the information returned to a specific index - -link:#[back to top] - -[[api-cluster-pendingtasks-5-2]] -=== `cluster.pendingTasks` - -[source,js] --------- -client.cluster.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master - -link:#[back to top] - -[[api-cluster-putsettings-5-2]] -=== `cluster.putSettings` - -[source,js] --------- -client.cluster.putSettings([params, [callback]]) --------- - -Update cluster wide specific settings. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-reroute-5-2]] -=== `cluster.reroute` - -[source,js] --------- -client.cluster.reroute([params, [callback]]) --------- - -Explicitly execute a cluster reroute allocation command including specific commands. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`dryRun`:: -<> -- Simulate the operation only and return the resulting state -`explain`:: -<> -- Return an explanation of why the commands can or cannot be executed -`retryFailed`:: -<> -- Retries allocation of shards that are blocked due to too many subsequent allocation failures -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics. Defaults to all but metadata -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-state-5-2]] -=== `cluster.state` - -[source,js] --------- -client.cluster.state([params, [callback]]) --------- - -Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics - -link:#[back to top] - -[[api-cluster-stats-5-2]] -=== `cluster.stats` - -[source,js] --------- -client.cluster.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-indices-analyze-5-2]] -=== `indices.analyze` - -[source,js] --------- -client.indices.analyze([params, [callback]]) --------- - -Perform the analysis process on a text and return the tokens breakdown of the text. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The name of the analyzer to use -`charFilter`:: -<>, <>, <> -- A comma-separated list of character filters to use for the analysis -`field`:: -<> -- Use the analyzer configured for this field (instead of passing the analyzer name) -`filter`:: -<>, <>, <> -- A comma-separated list of filters to use for the analysis -`index`:: -<> -- The name of the index to scope the operation -`preferLocal`:: -<> -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) -`text`:: -<>, <>, <> -- The text on which the analysis should be performed (when request body is not used) -`tokenizer`:: -<> -- The name of the tokenizer to use for the analysis -`explain`:: -<> -- With `true`, outputs more advanced details. (default: false) -`attributes`:: -<>, <>, <> -- A comma-separated list of token attributes to output, this parameter works only with `explain=true` -`[format=detailed]`:: -<> -- Format of the output -Options::: - * `"detailed"` - * `"text"` - -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-clearcache-5-2]] -=== `indices.clearCache` - -[source,js] --------- -client.indices.clearCache([params, [callback]]) --------- - -Clear either all caches or specific cached associated with one ore more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fieldData`:: -<> -- Clear field data -`fielddata`:: -<> -- Clear field data -`fields`:: -<>, <>, <> -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all) -`query`:: -<> -- Clear query caches -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index name to limit the operation -`recycler`:: -<> -- Clear the recycler cache -`request`:: -<> -- Clear request cache -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-close-5-2]] -=== `indices.close` - -[source,js] --------- -client.indices.close([params, [callback]]) --------- - -Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to close -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-create-5-2]] -=== `indices.create` - -[source,js] --------- -client.indices.create([params, [callback]]) --------- - -Create an index in Elasticsearch. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for before the operation returns. -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`index`:: -<> -- The name of the index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-delete-5-2]] -=== `indices.delete` - -[source,js] --------- -client.indices.delete([params, [callback]]) --------- - -Delete an index in Elasticsearch - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletealias-5-2]] -=== `indices.deleteAlias` - -[source,js] --------- -client.indices.deleteAlias([params, [callback]]) --------- - -Delete a specific alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names (supports wildcards); use `_all` for all indices -`name`:: -<>, <>, <> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletetemplate-5-2]] -=== `indices.deleteTemplate` - -[source,js] --------- -client.indices.deleteTemplate([params, [callback]]) --------- - -Delete an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-exists-5-2]] -=== `indices.exists` - -[source,js] --------- -client.indices.exists([params, [callback]]) --------- - -Return a boolean indicating whether given index exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of indices to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existsalias-5-2]] -=== `indices.existsAlias` - -[source,js] --------- -client.indices.existsAlias([params, [callback]]) --------- - -Return a boolean indicating whether given alias exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstemplate-5-2]] -=== `indices.existsTemplate` - -[source,js] --------- -client.indices.existsTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstype-5-2]] -=== `indices.existsType` - -[source,js] --------- -client.indices.existsType([params, [callback]]) --------- - -Check if a type/types exists in an index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` to check the types across all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flush-5-2]] -=== `indices.flush` - -[source,js] --------- -client.indices.flush([params, [callback]]) --------- - -Explicitly flush one or more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`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. -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flushsynced-5-2]] -=== `indices.flushSynced` - -[source,js] --------- -client.indices.flushSynced([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-forcemerge-5-2]] -=== `indices.forcemerge` - -[source,js] --------- -client.indices.forcemerge([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flush`:: -<> -- Specify whether the index should be flushed after performing the operation (default: true) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`maxNumSegments`:: -<> -- The number of segments the index should be merged into (default: dynamic) -`onlyExpungeDeletes`:: -<> -- Specify whether the operation should only expunge deleted documents -`operationThreading`:: -anything -- TODO: ? -`waitForMerge`:: -<> -- Specify whether the request should block until the merge process is finished (default: true) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-get-5-2]] -=== `indices.get` - -[source,js] --------- -client.indices.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Ignore unavailable indexes (default: false) -`allowNoIndices`:: -<> -- Ignore if a wildcard expression resolves to no concrete indices (default: false) -`[expandWildcards=open]`:: -<> -- Whether wildcard expressions should get expanded to open or closed indices (default: open) -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return version and creation date values in human-readable format. -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names -`feature`:: -<>, <>, <> -- A comma-separated list of features - -link:#[back to top] - -[[api-indices-getalias-5-2]] -=== `indices.getAlias` - -[source,js] --------- -client.indices.getAlias([params, [callback]]) --------- - -Retrieve a specified alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=all]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-indices-getfieldmapping-5-2]] -=== `indices.getFieldMapping` - -[source,js] --------- -client.indices.getFieldMapping([params, [callback]]) --------- - -Retrieve mapping definition of a specific field. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeDefaults`:: -<> -- Whether the default mapping values should be returned as well -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types -`fields`:: -<>, <>, <> -- A comma-separated list of fields - -link:#[back to top] - -[[api-indices-getmapping-5-2]] -=== `indices.getMapping` - -[source,js] --------- -client.indices.getMapping([params, [callback]]) --------- - -Retrieve mapping definition of index or index/type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types - -link:#[back to top] - -[[api-indices-getsettings-5-2]] -=== `indices.getSettings` - -[source,js] --------- -client.indices.getSettings([params, [callback]]) --------- - -Retrieve settings for one or more (or all) indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`human`:: -<> -- Whether to return version and creation date values in human-readable format. -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`name`:: -<>, <>, <> -- The name of the settings that should be included - -link:#[back to top] - -[[api-indices-gettemplate-5-2]] -=== `indices.getTemplate` - -[source,js] --------- -client.indices.getTemplate([params, [callback]]) --------- - -Retrieve an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<>, <>, <> -- The comma separated names of the index templates - -link:#[back to top] - -[[api-indices-getupgrade-5-2]] -=== `indices.getUpgrade` - -[source,js] --------- -client.indices.getUpgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-open-5-2]] -=== `indices.open` - -[source,js] --------- -client.indices.open([params, [callback]]) --------- - -Open a closed index, making it available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to open -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putalias-5-2]] -=== `indices.putAlias` - -[source,js] --------- -client.indices.putAlias([params, [callback]]) --------- - -Create an alias for a specific index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -`name`:: -<> -- The name of the alias to be created or updated -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putmapping-5-2]] -=== `indices.putMapping` - -[source,js] --------- -client.indices.putMapping([params, [callback]]) --------- - -Register specific mapping definition for a specific type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`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. -`type`:: -<> -- The name of the document type -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putsettings-5-2]] -=== `indices.putSettings` - -[source,js] --------- -client.indices.putSettings([params, [callback]]) --------- - -Change specific index level settings in real time. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Specify timeout for connection to master -`preserveExisting`:: -<> -- Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-puttemplate-5-2]] -=== `indices.putTemplate` - -[source,js] --------- -client.indices.putTemplate([params, [callback]]) --------- - -Create an index template that will automatically be applied to new indices created. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`order`:: -<> -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) -`create`:: -<> -- Whether the index template should only be added if new or can also replace an existing one -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-recovery-5-2]] -=== `indices.recovery` - -[source,js] --------- -client.indices.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`detailed`:: -<> -- Whether to display detailed information about shard recovery -`activeOnly`:: -<> -- Display only those recoveries that are currently on-going -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`index`:: -<>, <>, <> -- 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-5-2]] -=== `indices.refresh` - -[source,js] --------- -client.indices.refresh([params, [callback]]) --------- - -Explicitly refresh one or more index, making all operations performed since the last refresh available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-rollover-5-2]] -=== `indices.rollover` - -[source,js] --------- -client.indices.rollover([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`dryRun`:: -<> -- If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the newly created rollover index before the operation returns. -`alias`:: -<> -- The name of the alias to rollover -`newIndex`:: -<> -- The name of the rollover index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-segments-5-2]] -=== `indices.segments` - -[source,js] --------- -client.indices.segments([params, [callback]]) --------- - -Retrieve low level segments information that a Lucene index (shard level) is built with. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`operationThreading`:: -anything -- TODO: ? -`verbose`:: -<> -- Includes detailed memory usage by Lucene. -`index`:: -<>, <>, <> -- 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-5-2]] -=== `indices.shardStores` - -[source,js] --------- -client.indices.shardStores([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`status`:: -<>, <>, <> -- A comma-separated list of statuses used to filter on shards to get store information for -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-shrink-5-2]] -=== `indices.shrink` - -[source,js] --------- -client.indices.shrink([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the shrunken index before the operation returns. -`index`:: -<> -- The name of the source index to shrink -`target`:: -<> -- The name of the target index to shrink into -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-stats-5-2]] -=== `indices.stats` - -[source,js] --------- -client.indices.stats([params, [callback]]) --------- - -Retrieve statistics on different operations happening on an index. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<>, <>, <> -- A comma-separated list of search groups for `search` index metric -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`[level=indices]`:: -<> -- Return stats aggregated at cluster, index or shard level -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned the specific metrics. - -link:#[back to top] - -[[api-indices-updatealiases-5-2]] -=== `indices.updateAliases` - -[source,js] --------- -client.indices.updateAliases([params, [callback]]) --------- - -Update specified aliases. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform an atomic alias swap, for a rotating index -[source,js] ---------- -const response = await client.indices.updateAliases({ - body: { - actions: [ - { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } }, - { add: { index: 'logstash-2014.05', alias: 'logstash-current' } } - ] - } -}); ---------- - - - -*Params* - -[horizontal] -`timeout`:: -<> -- Request timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-upgrade-5-2]] -=== `indices.upgrade` - -[source,js] --------- -client.indices.upgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`waitForCompletion`:: -<> -- Specify whether the request should block until the all segments are upgraded (default: false) -`onlyAncientSegments`:: -<> -- If true, only ancient (an older Lucene major release) segments will be upgraded -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-validatequery-5-2]] -=== `indices.validateQuery` - -[source,js] --------- -client.indices.validateQuery([params, [callback]]) --------- - -Validate a potentially expensive query without executing it. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-validate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`explain`:: -<> -- Return detailed information about the error -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`rewrite`:: -<> -- Provide a more detailed explanation showing the actual Lucene query that will be executed. -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-validate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-deletepipeline-5-2]] -=== `ingest.deletePipeline` - -[source,js] --------- -client.ingest.deletePipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-getpipeline-5-2]] -=== `ingest.getPipeline` - -[source,js] --------- -client.ingest.getPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`id`:: -<> -- Comma separated list of pipeline ids. Wildcards supported - -link:#[back to top] - -[[api-ingest-putpipeline-5-2]] -=== `ingest.putPipeline` - -[source,js] --------- -client.ingest.putPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-simulate-5-2]] -=== `ingest.simulate` - -[source,js] --------- -client.ingest.simulate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`verbose`:: -<> -- Verbose mode. Display data output for each processor in executed pipeline -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-nodes-hotthreads-5-2]] -=== `nodes.hotThreads` - -[source,js] --------- -client.nodes.hotThreads([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`interval`:: -<> -- The interval for the second sampling of threads -`snapshots`:: -<> -- Number of samples of thread stacktrace (default: 10) -`threads`:: -<> -- Specify the number of threads to provide information for (default: 3) -`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) -`type`:: -<> -- The type to sample (default: cpu) -Options::: - * `"cpu"` - * `"wait"` - * `"block"` - -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-nodes-info-5-2]] -=== `nodes.info` - -[source,js] --------- -client.nodes.info([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`timeout`:: -<> -- Explicit operation timeout -`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 -`metric`:: -<>, <>, <> -- A comma-separated list of metrics you wish returned. Leave empty to return all. - -link:#[back to top] - -[[api-nodes-stats-5-2]] -=== `nodes.stats` - -[source,js] --------- -client.nodes.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<> -- A comma-separated list of search groups for `search` index metric -`human`:: -<> -- Whether to return time and byte values in human-readable format. -`[level=node]`:: -<> -- Return indices stats aggregated at index, node or shard level -Options::: - * `"indices"` - * `"node"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`timeout`:: -<> -- Explicit operation timeout -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics -`indexMetric`:: -<>, <>, <> -- Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. -`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 - -link:#[back to top] - -[[api-snapshot-create-5-2]] -=== `snapshot.create` - -[source,js] --------- -client.snapshot.create([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-createrepository-5-2]] -=== `snapshot.createRepository` - -[source,js] --------- -client.snapshot.createRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`verify`:: -<> -- Whether to verify the repository after creation -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-delete-5-2]] -=== `snapshot.delete` - -[source,js] --------- -client.snapshot.delete([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-deleterepository-5-2]] -=== `snapshot.deleteRepository` - -[source,js] --------- -client.snapshot.deleteRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<>, <>, <> -- A comma-separated list of repository names -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-get-5-2]] -=== `snapshot.get` - -[source,js] --------- -client.snapshot.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-getrepository-5-2]] -=== `snapshot.getRepository` - -[source,js] --------- -client.snapshot.getRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`repository`:: -<>, <>, <> -- A comma-separated list of repository names - -link:#[back to top] - -[[api-snapshot-restore-5-2]] -=== `snapshot.restore` - -[source,js] --------- -client.snapshot.restore([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-status-5-2]] -=== `snapshot.status` - -[source,js] --------- -client.snapshot.status([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-verifyrepository-5-2]] -=== `snapshot.verifyRepository` - -[source,js] --------- -client.snapshot.verifyRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-cancel-5-2]] -=== `tasks.cancel` - -[source,js] --------- -client.tasks.cancel([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all. -`parentNode`:: -<> -- Cancel tasks with specified parent node. -`parentTask`:: -<> -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. -`taskId`:: -<> -- Cancel the task with specified task id (node_id:task_number) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-get-5-2]] -=== `tasks.get` - -[source,js] --------- -client.tasks.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`taskId`:: -<> -- Return the task with specified id (node_id:task_number) - -link:#[back to top] - -[[api-tasks-list-5-2]] -=== `tasks.list` - -[source,js] --------- -client.tasks.list([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`[groupBy=nodes]`:: -<> -- Group tasks by nodes or parent/child relationships -Options::: - * `"nodes"` - * `"parents"` - - -link:#[back to top] diff --git a/docs/api_methods_5_3.asciidoc b/docs/api_methods_5_3.asciidoc deleted file mode 100644 index 74abf7749..000000000 --- a/docs/api_methods_5_3.asciidoc +++ /dev/null @@ -1,5317 +0,0 @@ -[[api-reference-5-3]] -== 5.3 API - - -NOTE: At this time, you must opt into the 5.3 API by setting the `apiVersion` config parameter. - - -[[api-bulk-5-3]] -=== `bulk` - -[source,js] --------- -client.bulk([params, [callback]]) --------- - -Perform many index/delete operations in a single API call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform three operations in a single request -[source,js] ---------- -client.bulk({ - body: [ - // action description - { index: { _index: 'myindex', _type: 'mytype', _id: 1 } }, - // the document to index - { title: 'foo' }, - // action description - { update: { _index: 'myindex', _type: 'mytype', _id: 2 } }, - // the document to update - { doc: { title: 'foo' } }, - // action description - { delete: { _index: 'myindex', _type: 'mytype', _id: 3 } }, - // no document needed for this delete - ] -}, function (err, resp) { - // ... -}); ---------- - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- 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`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`type`:: -<> -- Default document type for items which don't provide one -`fields`:: -<>, <>, <> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request -`_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 -`_sourceExclude`:: -<>, <>, <> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -`_sourceInclude`:: -<>, <>, <> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`index`:: -<> -- Default index for items which don't provide one -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-clearscroll-5-3]] -=== `clearScroll` - -[source,js] --------- -client.clearScroll([params, [callback]]) --------- - -Clear the scroll request created by specifying the scroll parameter to search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`scrollId`:: -<>, <>, <> -- A comma-separated list of scroll IDs to clear -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-count-5-3]] -=== `count` - -[source,js] --------- -client.count([params, [callback]]) --------- - -Get the number of documents for the cluster, index, type, or a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-count.html[the elasticsearch docs] for more information pertaining to this method. - -.Get the number of all documents in the cluster -[source,js] ---------- -const { count } = await client.count(); ---------- - -.Get the number of documents in an index -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name' -}); ---------- - -.Get the number of documents matching a query -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name', - body: { - query: { - filtered: { - filter: { - terms: { - foo: ['bar'] - } - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`minScore`:: -<> -- Include only documents with a specific `_score` value in the result -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`index`:: -<>, <>, <> -- A comma-separated list of indices to restrict the results -`type`:: -<>, <>, <> -- A comma-separated list of types to restrict the results -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-count.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-countpercolate-5-3]] -=== `countPercolate` - -[source,js] --------- -client.countPercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to count percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to count percolate document into. Defaults to type. -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being count percolated. -`type`:: -<> -- The type of the document being count percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-create-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create a document -[source,js] ---------- -await client.create({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - published_at: '2013-01-01', - counter: 1 - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-delete-5-3]] -=== `delete` - -[source,js] --------- -client.delete([params, [callback]]) --------- - -Delete a typed JSON document from a specific index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. - -.Delete the document `/myindex/mytype/1` -[source,js] ---------- -await client.delete({ - index: 'myindex', - type: 'mytype', - id: '1' -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-delete.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletebyquery-5-3]] -=== `deleteByQuery` - -[source,js] --------- -client.deleteByQuery([params, [callback]]) --------- - -Delete documents from one or more indices and one or more types based on a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -.Deleting documents with a simple query -[source,js] ---------- -await client.deleteByQuery({ - index: 'myindex', - q: 'test' -}); ---------- - -.Deleting documents using the Query DSL -[source,js] ---------- -await client.deleteByQuery({ - index: 'posts', - body: { - query: { - term: { published: false } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the delete-by-query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`[waitForCompletion=true]`:: -<> -- Should the request should block until the delete-by-query is complete. -`requestsPerSecond`:: -<> -- The throttle for this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletescript-5-3]] -=== `deleteScript` - -[source,js] --------- -client.deleteScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletetemplate-5-3]] -=== `deleteTemplate` - -[source,js] --------- -client.deleteTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-exists-5-3]] -=== `exists` - -[source,js] --------- -client.exists([params, [callback]]) --------- - -Returns a boolean indicating whether or not a given document exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Check that the document `/myindex/mytype/1` exist -[source,js] ---------- -const exists = await client.exists({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-explain-5-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. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-explain.html[the elasticsearch docs] for more information pertaining to this method. - -.See how a document is scored against a simple query -[source,js] ---------- -const response = await client.explain({ - // the document to test - index: 'myindex', - type: 'mytype', - id: '1', - - // the query to score it against - q: 'field:value' -}); ---------- - -.See how a document is scored against a query written in the Query DSL -[source,js] ---------- -const response = await client.explain({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - query: { - match: { title: 'test' } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzeWildcard`:: -<> -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -`analyzer`:: -<> -- The analyzer for the query string query -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The default field for query string query (default: _all) -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-fieldstats-5-3]] -=== `fieldStats` - -[source,js] --------- -client.fieldStats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-field-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fields`:: -<>, <>, <> -- A comma-separated list of fields for to get field statistics for (min value, max value, and more) -`[level=cluster]`:: -<> -- Defines if field stats should be returned on a per index level or on a cluster wide level -Options::: - * `"indices"` - * `"cluster"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-field-stats.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-get-5-3]] -=== `get` - -[source,js] --------- -client.get([params, [callback]]) --------- - -Get a typed JSON document from the index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Get `/myindex/mytype/1` -[source,js] ---------- -const response = await client.get({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) - -link:#[back to top] - -[[api-getscript-5-3]] -=== `getScript` - -[source,js] --------- -client.getScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language - -link:#[back to top] - -[[api-getsource-5-3]] -=== `getSource` - -[source,js] --------- -client.getSource([params, [callback]]) --------- - -Get the source of a document by its index, type and id. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document; use `_all` to fetch the first document matching the ID across all types - -link:#[back to top] - -[[api-gettemplate-5-3]] -=== `getTemplate` - -[source,js] --------- -client.getTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID - -link:#[back to top] - -[[api-index-5-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 <>. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create or update a document -[source,js] ---------- -const response = await client.index({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -`[opType=index]`:: -<> -- Explicit operation type -Options::: - * `"index"` - * `"create"` - -`parent`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-info-5-3]] -=== `info` - -[source,js] --------- -client.info([params, [callback]]) --------- - -Get basic info from the current cluster. - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-mget-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. - -.An array of doc locations. Useful for getting documents from different indices. -[source,js] ---------- -const response = await client.mget({ - body: { - docs: [ - { _index: 'indexA', _type: 'typeA', _id: '1' }, - { _index: 'indexB', _type: 'typeB', _id: '1' }, - { _index: 'indexC', _type: 'typeC', _id: '1' } - ] - } -}); ---------- - -.An array of ids. You must also specify the `index` and `type` that apply to all of the ids. -[source,js] ---------- -const response = await client.mget({ - index: 'myindex', - type: 'mytype', - body: { - ids: [1, 2, 3] - } -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mpercolate-5-3]] -=== `mpercolate` - -[source,js] --------- -client.mpercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<> -- The index of the document being count percolated to use as default -`type`:: -<> -- The type of the document being percolated to use as default. -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearch-5-3]] -=== `msearch` - -[source,js] --------- -client.msearch([params, [callback]]) --------- - -Execute several search requests within the same request. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform multiple different searches, the body is made up of meta/data pairs -[source,js] ---------- -const response = await client.msearch({ - body: [ - // match all query, on all indices and types - {}, - { query: { match_all: {} } }, - - // query_string query, on index/mytype - { index: 'myindex', type: 'mytype' }, - { query: { query_string: { query: '"Test 1"' } } } - ] -}); ---------- - - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`maxConcurrentSearches`:: -<> -- Controls the maximum number of concurrent searches the multi search api will execute -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearchtemplate-5-3]] -=== `msearchTemplate` - -[source,js] --------- -client.msearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mtermvectors-5-3]] -=== `mtermvectors` - -[source,js] --------- -client.mtermvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ids`:: -<>, <>, <> -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body -`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". -`[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". -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[positions=true]`:: -<> -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`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". -`routing`:: -<> -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`parent`:: -<> -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`realtime`:: -<> -- Specifies if requests are real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-percolate-5-3]] -=== `percolate` - -[source,js] --------- -client.percolate([params, [callback]]) --------- - -Match a document against registered percolator queries. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -.First, Register queries named “alert-1” and “alert-2” for the “myindex” index -[source,js] ---------- -await Promise.all([ - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-1', - body: { - // This query will be run against documents sent to percolate - query: { - query_string: { - query: 'foo' - } - } - } - }), - - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-2', - body: { - // This query will also be run against documents sent to percolate - query: { - query_string: { - query: 'bar' - } - } - } - }) -]); ---------- - -.Then you can send documents to learn which query `_percolator` queries they match -[source,js] ---------- -const response1 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo" - } - } -}); - -// response1 should look something like -// { -// total: 1, -// matches: [ { _index: 'myindex', _id: 'alert-1' } ] -// } - -const response2 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo Bar" - } - } -}); - -// response2 should look something like -// { -// total: 2, -// matches: [ -// { _index: 'myindex', _id: 'alert-1' }, -// { _index: 'myindex', _id: 'alert-2' } -// ] -// } ---------- - - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to percolate document into. Defaults to type. -`percolateRouting`:: -<> -- The routing value to use when percolating the existing document. -`percolatePreference`:: -<> -- Which shard to prefer when executing the percolate request. -`percolateFormat`:: -<> -- Return an array of matching query IDs instead of objects -Options::: - * `"ids"` - -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being percolated. -`type`:: -<> -- The type of the document being percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ping-5-3]] -=== `ping` - -[source,js] --------- -client.ping([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-putscript-5-3]] -=== `putScript` - -[source,js] --------- -client.putScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-puttemplate-5-3]] -=== `putTemplate` - -[source,js] --------- -client.putTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindex-5-3]] -=== `reindex` - -[source,js] --------- -client.reindex([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`[waitForCompletion=true]`:: -<> -- Should the request should block until the reindex is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindexrethrottle-5-3]] -=== `reindexRethrottle` - -[source,js] --------- -client.reindexRethrottle([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`requestsPerSecond`:: -<> -- The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. -`taskId`:: -<> -- The task id to rethrottle -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-rendersearchtemplate-5-3]] -=== `renderSearchTemplate` - -[source,js] --------- -client.renderSearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- The id of the stored search template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-scroll-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -.Collect every title in the index that contains the word "test" -[source,js] ---------- -const allTitles = []; -const responseQueue = []; - -// start things off by searching, setting a scroll timeout, and pushing -// our first response into the queue to be processed -await client.search({ - index: 'myindex', - scroll: '30s', // keep the search results "scrollable" for 30 seconds - source: ['title'], // filter the source to only include the title field - q: 'title:test' -}) - -while (responseQueue.length) { - const response = responseQueue.shift(); - - // collect the titles from this response - response.hits.hits.forEach(function (hit) { - allTitles.push(hit.fields.title); - }); - - // check to see if we have collected all of the titles - if (response.hits.total === allTitles.length) { - console.log('every "test" title', allTitles); - break - } - - // get the next response if there are more titles to fetch - responseQueue.push( - await client.scroll({ - scrollId: response._scroll_id, - scroll: '30s' - }) - ); -} ---------- - - - -*Params* - -[horizontal] -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`scrollId`:: -<> -- The scroll ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-search-5-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/danpaz/bodybuilder[bodybuilder] and https://github.com/sudo-suhas/elastic-builder[elastic-builder] can be used to make building query bodies easier. - - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Search with a simple query string query -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - q: 'title:test' -}); ---------- - -.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash` -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - body: { - query: { - match: { - title: 'test' - } - }, - facets: { - tags: { - terms: { - field: 'tags' - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return as part of a hit -`docvalueFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`suggestField`:: -<> -- Specify which field to use for suggestions -`[suggestMode=missing]`:: -<> -- Specify suggest mode -Options::: - * `"missing"` - * `"popular"` - * `"always"` - -`suggestSize`:: -<> -- How many suggestions to return in response -`suggestText`:: -<> -- The source text for which the suggestions should be returned -`timeout`:: -<> -- Explicit operation timeout -`trackScores`:: -<> -- Whether to calculate and return scores even if they are not used for sorting -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchshards-5-3]] -=== `searchShards` - -[source,js] --------- -client.searchShards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-shards.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchtemplate-5-3]] -=== `searchTemplate` - -[source,js] --------- -client.searchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`profile`:: -<> -- Specify whether to profile the query execution -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-suggest-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-suggesters.html[the elasticsearch docs] for more information pertaining to this method. - -.Return query terms suggestions (“auto-correction”) -[source,js] ---------- -const response = await client.suggest({ - index: 'myindex', - body: { - mysuggester: { - text: 'tset', - term: { - field: 'title' - } - } - } -}); - -// response will be formatted like so: -// -// { -// ... -// mysuggester: [ -// { -// text: "tset", -// ... -// options: [ -// { -// text: "test", -// score: 0.75, -// freq: 5 -// } -// ] -// } -// ] -// } - ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-suggesters.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-termvectors-5-3]] -=== `termvectors` - -[source,js] --------- -client.termvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`termStatistics`:: -<> -- Specifies if total term frequency and document frequency should be returned. -`[fieldStatistics=true]`:: -<> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. -`[positions=true]`:: -<> -- Specifies if term positions should be returned. -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random). -`routing`:: -<> -- Specific routing value. -`parent`:: -<> -- Parent id of documents. -`realtime`:: -<> -- Specifies if request is real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`id`:: -<> -- The id of the document, when not specified a doc param should be supplied. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-update-5-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 - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update.html[the elasticsearch docs] for more information pertaining to this method. - -.Update document title using partial document -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - // put the partial document under the `doc` key - doc: { - title: 'Updated' - } - } -}) ---------- - -.Add a tag to document `tags` property using a `script` -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags += tag', - params: { tag: 'some new tag' } - } -}); ---------- - -.Increment a document counter by 1 or initialize it, when the document does not exist -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '777', - body: { - script: 'ctx._source.counter += 1', - upsert: { - counter: 1 - } - } -}) ---------- - -.Delete a document if it's tagged “to-delete” -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"', - params: { - tag: 'to-delete' - } - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<>, <>, <> -- A comma-separated list of fields to return in the response -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`lang`:: -<> -- The script language (default: painless) -`parent`:: -<> -- ID of the parent document. Is is only used for routing and when for the upsert request -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`retryOnConflict`:: -<> -- Specify how many times should the operation be retried when a conflict occurs (default: 0) -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"force"` - -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-updatebyquery-5-3]] -=== `updateByQuery` - -[source,js] --------- -client.updateByQuery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the update by query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`pipeline`:: -<> -- Ingest pipeline to set on index requests made by this action. (default: none) -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`versionType`:: -<> -- Should the document increment the version number (internal) on hit or not (reindex) -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`[waitForCompletion=true]`:: -<> -- Should the request should block until the update by query operation is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cat-aliases-5-3]] -=== `cat.aliases` - -[source,js] --------- -client.cat.aliases([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-cat-allocation-5-3]] -=== `cat.allocation` - -[source,js] --------- -client.cat.allocation([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`nodeId`:: -<>, <>, <> -- A comma-separated list of node IDs or names to limit the returned information - -link:#[back to top] - -[[api-cat-count-5-3]] -=== `cat.count` - -[source,js] --------- -client.cat.count([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-count.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-fielddata-5-3]] -=== `cat.fielddata` - -[source,js] --------- -client.cat.fielddata([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return the fielddata size - -link:#[back to top] - -[[api-cat-health-5-3]] -=== `cat.health` - -[source,js] --------- -client.cat.health([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`[ts=true]`:: -<> -- Set to false to disable timestamping -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-help-5-3]] -=== `cat.help` - -[source,js] --------- -client.cat.help([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by - -link:#[back to top] - -[[api-cat-indices-5-3]] -=== `cat.indices` - -[source,js] --------- -client.cat.indices([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"m"` - * `"g"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`health`:: -<> -- A health status ("green", "yellow", or "red" to filter only indices matching the specified health status -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`help`:: -<> -- Return help information -`pri`:: -<> -- Set to true to return stats only for primary shards -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-master-5-3]] -=== `cat.master` - -[source,js] --------- -client.cat.master([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-master.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodeattrs-5-3]] -=== `cat.nodeattrs` - -[source,js] --------- -client.cat.nodeattrs([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodes-5-3]] -=== `cat.nodes` - -[source,js] --------- -client.cat.nodes([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`fullId`:: -<> -- Return the full node ID instead of the shortened version (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-pendingtasks-5-3]] -=== `cat.pendingTasks` - -[source,js] --------- -client.cat.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-plugins-5-3]] -=== `cat.plugins` - -[source,js] --------- -client.cat.plugins([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-recovery-5-3]] -=== `cat.recovery` - -[source,js] --------- -client.cat.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-repositories-5-3]] -=== `cat.repositories` - -[source,js] --------- -client.cat.repositories([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-segments-5-3]] -=== `cat.segments` - -[source,js] --------- -client.cat.segments([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-shards-5-3]] -=== `cat.shards` - -[source,js] --------- -client.cat.shards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-snapshots-5-3]] -=== `cat.snapshots` - -[source,js] --------- -client.cat.snapshots([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`ignoreUnavailable`:: -<> -- Set to true to ignore unavailable snapshots -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`repository`:: -<>, <>, <> -- Name of repository from which to fetch the snapshot information - -link:#[back to top] - -[[api-cat-tasks-5-3]] -=== `cat.tasks` - -[source,js] --------- -client.cat.tasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id. Set to -1 to return all. -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-templates-5-3]] -=== `cat.templates` - -[source,js] --------- -client.cat.templates([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<> -- A pattern that returned template names must match - -link:#[back to top] - -[[api-cat-threadpool-5-3]] -=== `cat.threadPool` - -[source,js] --------- -client.cat.threadPool([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`size`:: -<> -- The multiplier in which to display values -Options::: - * `""` - * `"k"` - * `"m"` - * `"g"` - * `"t"` - * `"p"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`threadPoolPatterns`:: -<>, <>, <> -- A comma-separated list of regular-expressions to filter the thread pools in the output - -link:#[back to top] - -[[api-cluster-allocationexplain-5-3]] -=== `cluster.allocationExplain` - -[source,js] --------- -client.cluster.allocationExplain([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeYesDecisions`:: -<> -- Return 'YES' decisions in explanation (default: false) -`includeDiskInfo`:: -<> -- Return information about disk usage and shard sizes (default: false) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-getsettings-5-3]] -=== `cluster.getSettings` - -[source,js] --------- -client.cluster.getSettings([params, [callback]]) --------- - -Get cluster settings (previously set with `putSettings()`) - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`includeDefaults`:: -<> -- Whether to return all default clusters setting. - -link:#[back to top] - -[[api-cluster-health-5-3]] -=== `cluster.health` - -[source,js] --------- -client.cluster.health([params, [callback]]) --------- - -Get a very simple status on the health of the cluster. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`[level=cluster]`:: -<> -- Specify the level of detail for returned information -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`waitForActiveShards`:: -<> -- Wait until the specified number of shards is active -`waitForNodes`:: -<> -- Wait until the specified number of nodes is available -`waitForEvents`:: -<> -- Wait until all currently queued events with the given priority are processed -Options::: - * `"immediate"` - * `"urgent"` - * `"high"` - * `"normal"` - * `"low"` - * `"languid"` - -`waitForNoRelocatingShards`:: -<> -- Whether to wait until there are no relocating shards in the cluster -`waitForStatus`:: -<> -- Wait until cluster is in a specific state -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`index`:: -<>, <>, <> -- Limit the information returned to a specific index - -link:#[back to top] - -[[api-cluster-pendingtasks-5-3]] -=== `cluster.pendingTasks` - -[source,js] --------- -client.cluster.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master - -link:#[back to top] - -[[api-cluster-putsettings-5-3]] -=== `cluster.putSettings` - -[source,js] --------- -client.cluster.putSettings([params, [callback]]) --------- - -Update cluster wide specific settings. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-reroute-5-3]] -=== `cluster.reroute` - -[source,js] --------- -client.cluster.reroute([params, [callback]]) --------- - -Explicitly execute a cluster reroute allocation command including specific commands. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`dryRun`:: -<> -- Simulate the operation only and return the resulting state -`explain`:: -<> -- Return an explanation of why the commands can or cannot be executed -`retryFailed`:: -<> -- Retries allocation of shards that are blocked due to too many subsequent allocation failures -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics. Defaults to all but metadata -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-state-5-3]] -=== `cluster.state` - -[source,js] --------- -client.cluster.state([params, [callback]]) --------- - -Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics - -link:#[back to top] - -[[api-cluster-stats-5-3]] -=== `cluster.stats` - -[source,js] --------- -client.cluster.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-indices-analyze-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The name of the analyzer to use -`charFilter`:: -<>, <>, <> -- A comma-separated list of character filters to use for the analysis -`field`:: -<> -- Use the analyzer configured for this field (instead of passing the analyzer name) -`filter`:: -<>, <>, <> -- A comma-separated list of filters to use for the analysis -`index`:: -<> -- The name of the index to scope the operation -`preferLocal`:: -<> -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) -`text`:: -<>, <>, <> -- The text on which the analysis should be performed (when request body is not used) -`tokenizer`:: -<> -- The name of the tokenizer to use for the analysis -`explain`:: -<> -- With `true`, outputs more advanced details. (default: false) -`attributes`:: -<>, <>, <> -- A comma-separated list of token attributes to output, this parameter works only with `explain=true` -`[format=detailed]`:: -<> -- Format of the output -Options::: - * `"detailed"` - * `"text"` - -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-clearcache-5-3]] -=== `indices.clearCache` - -[source,js] --------- -client.indices.clearCache([params, [callback]]) --------- - -Clear either all caches or specific cached associated with one ore more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fieldData`:: -<> -- Clear field data -`fielddata`:: -<> -- Clear field data -`fields`:: -<>, <>, <> -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all) -`query`:: -<> -- Clear query caches -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index name to limit the operation -`recycler`:: -<> -- Clear the recycler cache -`request`:: -<> -- Clear request cache -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-close-5-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. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to close -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-create-5-3]] -=== `indices.create` - -[source,js] --------- -client.indices.create([params, [callback]]) --------- - -Create an index in Elasticsearch. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for before the operation returns. -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`index`:: -<> -- The name of the index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-delete-5-3]] -=== `indices.delete` - -[source,js] --------- -client.indices.delete([params, [callback]]) --------- - -Delete an index in Elasticsearch - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletealias-5-3]] -=== `indices.deleteAlias` - -[source,js] --------- -client.indices.deleteAlias([params, [callback]]) --------- - -Delete a specific alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names (supports wildcards); use `_all` for all indices -`name`:: -<>, <>, <> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletetemplate-5-3]] -=== `indices.deleteTemplate` - -[source,js] --------- -client.indices.deleteTemplate([params, [callback]]) --------- - -Delete an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-exists-5-3]] -=== `indices.exists` - -[source,js] --------- -client.indices.exists([params, [callback]]) --------- - -Return a boolean indicating whether given index exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of indices to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existsalias-5-3]] -=== `indices.existsAlias` - -[source,js] --------- -client.indices.existsAlias([params, [callback]]) --------- - -Return a boolean indicating whether given alias exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstemplate-5-3]] -=== `indices.existsTemplate` - -[source,js] --------- -client.indices.existsTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstype-5-3]] -=== `indices.existsType` - -[source,js] --------- -client.indices.existsType([params, [callback]]) --------- - -Check if a type/types exists in an index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` to check the types across all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flush-5-3]] -=== `indices.flush` - -[source,js] --------- -client.indices.flush([params, [callback]]) --------- - -Explicitly flush one or more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`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. -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flushsynced-5-3]] -=== `indices.flushSynced` - -[source,js] --------- -client.indices.flushSynced([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-forcemerge-5-3]] -=== `indices.forcemerge` - -[source,js] --------- -client.indices.forcemerge([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flush`:: -<> -- Specify whether the index should be flushed after performing the operation (default: true) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`maxNumSegments`:: -<> -- The number of segments the index should be merged into (default: dynamic) -`onlyExpungeDeletes`:: -<> -- Specify whether the operation should only expunge deleted documents -`operationThreading`:: -anything -- TODO: ? -`waitForMerge`:: -<> -- Specify whether the request should block until the merge process is finished (default: true) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-get-5-3]] -=== `indices.get` - -[source,js] --------- -client.indices.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Ignore unavailable indexes (default: false) -`allowNoIndices`:: -<> -- Ignore if a wildcard expression resolves to no concrete indices (default: false) -`[expandWildcards=open]`:: -<> -- Whether wildcard expressions should get expanded to open or closed indices (default: open) -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names -`feature`:: -<>, <>, <> -- A comma-separated list of features - -link:#[back to top] - -[[api-indices-getalias-5-3]] -=== `indices.getAlias` - -[source,js] --------- -client.indices.getAlias([params, [callback]]) --------- - -Retrieve a specified alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=all]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-indices-getfieldmapping-5-3]] -=== `indices.getFieldMapping` - -[source,js] --------- -client.indices.getFieldMapping([params, [callback]]) --------- - -Retrieve mapping definition of a specific field. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeDefaults`:: -<> -- Whether the default mapping values should be returned as well -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types -`fields`:: -<>, <>, <> -- A comma-separated list of fields - -link:#[back to top] - -[[api-indices-getmapping-5-3]] -=== `indices.getMapping` - -[source,js] --------- -client.indices.getMapping([params, [callback]]) --------- - -Retrieve mapping definition of index or index/type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types - -link:#[back to top] - -[[api-indices-getsettings-5-3]] -=== `indices.getSettings` - -[source,js] --------- -client.indices.getSettings([params, [callback]]) --------- - -Retrieve settings for one or more (or all) indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`name`:: -<>, <>, <> -- The name of the settings that should be included - -link:#[back to top] - -[[api-indices-gettemplate-5-3]] -=== `indices.getTemplate` - -[source,js] --------- -client.indices.getTemplate([params, [callback]]) --------- - -Retrieve an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<>, <>, <> -- The comma separated names of the index templates - -link:#[back to top] - -[[api-indices-getupgrade-5-3]] -=== `indices.getUpgrade` - -[source,js] --------- -client.indices.getUpgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-open-5-3]] -=== `indices.open` - -[source,js] --------- -client.indices.open([params, [callback]]) --------- - -Open a closed index, making it available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to open -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putalias-5-3]] -=== `indices.putAlias` - -[source,js] --------- -client.indices.putAlias([params, [callback]]) --------- - -Create an alias for a specific index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -`name`:: -<> -- The name of the alias to be created or updated -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putmapping-5-3]] -=== `indices.putMapping` - -[source,js] --------- -client.indices.putMapping([params, [callback]]) --------- - -Register specific mapping definition for a specific type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`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. -`type`:: -<> -- The name of the document type -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putsettings-5-3]] -=== `indices.putSettings` - -[source,js] --------- -client.indices.putSettings([params, [callback]]) --------- - -Change specific index level settings in real time. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Specify timeout for connection to master -`preserveExisting`:: -<> -- Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-puttemplate-5-3]] -=== `indices.putTemplate` - -[source,js] --------- -client.indices.putTemplate([params, [callback]]) --------- - -Create an index template that will automatically be applied to new indices created. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`order`:: -<> -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) -`create`:: -<> -- Whether the index template should only be added if new or can also replace an existing one -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-recovery-5-3]] -=== `indices.recovery` - -[source,js] --------- -client.indices.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`detailed`:: -<> -- Whether to display detailed information about shard recovery -`activeOnly`:: -<> -- Display only those recoveries that are currently on-going -`index`:: -<>, <>, <> -- 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-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-rollover-5-3]] -=== `indices.rollover` - -[source,js] --------- -client.indices.rollover([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`dryRun`:: -<> -- If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the newly created rollover index before the operation returns. -`alias`:: -<> -- The name of the alias to rollover -`newIndex`:: -<> -- The name of the rollover index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-segments-5-3]] -=== `indices.segments` - -[source,js] --------- -client.indices.segments([params, [callback]]) --------- - -Retrieve low level segments information that a Lucene index (shard level) is built with. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`verbose`:: -<> -- Includes detailed memory usage by Lucene. -`index`:: -<>, <>, <> -- 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-5-3]] -=== `indices.shardStores` - -[source,js] --------- -client.indices.shardStores([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`status`:: -<>, <>, <> -- A comma-separated list of statuses used to filter on shards to get store information for -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-shrink-5-3]] -=== `indices.shrink` - -[source,js] --------- -client.indices.shrink([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the shrunken index before the operation returns. -`index`:: -<> -- The name of the source index to shrink -`target`:: -<> -- The name of the target index to shrink into -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-stats-5-3]] -=== `indices.stats` - -[source,js] --------- -client.indices.stats([params, [callback]]) --------- - -Retrieve statistics on different operations happening on an index. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<>, <>, <> -- A comma-separated list of search groups for `search` index metric -`[level=indices]`:: -<> -- Return stats aggregated at cluster, index or shard level -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned the specific metrics. - -link:#[back to top] - -[[api-indices-updatealiases-5-3]] -=== `indices.updateAliases` - -[source,js] --------- -client.indices.updateAliases([params, [callback]]) --------- - -Update specified aliases. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform an atomic alias swap, for a rotating index -[source,js] ---------- -const response = await client.indices.updateAliases({ - body: { - actions: [ - { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } }, - { add: { index: 'logstash-2014.05', alias: 'logstash-current' } } - ] - } -}); ---------- - - - -*Params* - -[horizontal] -`timeout`:: -<> -- Request timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-upgrade-5-3]] -=== `indices.upgrade` - -[source,js] --------- -client.indices.upgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`waitForCompletion`:: -<> -- Specify whether the request should block until the all segments are upgraded (default: false) -`onlyAncientSegments`:: -<> -- If true, only ancient (an older Lucene major release) segments will be upgraded -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-validatequery-5-3]] -=== `indices.validateQuery` - -[source,js] --------- -client.indices.validateQuery([params, [callback]]) --------- - -Validate a potentially expensive query without executing it. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-validate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`explain`:: -<> -- Return detailed information about the error -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`rewrite`:: -<> -- Provide a more detailed explanation showing the actual Lucene query that will be executed. -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-validate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-deletepipeline-5-3]] -=== `ingest.deletePipeline` - -[source,js] --------- -client.ingest.deletePipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-getpipeline-5-3]] -=== `ingest.getPipeline` - -[source,js] --------- -client.ingest.getPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`id`:: -<> -- Comma separated list of pipeline ids. Wildcards supported - -link:#[back to top] - -[[api-ingest-putpipeline-5-3]] -=== `ingest.putPipeline` - -[source,js] --------- -client.ingest.putPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-simulate-5-3]] -=== `ingest.simulate` - -[source,js] --------- -client.ingest.simulate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`verbose`:: -<> -- Verbose mode. Display data output for each processor in executed pipeline -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-nodes-hotthreads-5-3]] -=== `nodes.hotThreads` - -[source,js] --------- -client.nodes.hotThreads([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`interval`:: -<> -- The interval for the second sampling of threads -`snapshots`:: -<> -- Number of samples of thread stacktrace (default: 10) -`threads`:: -<> -- Specify the number of threads to provide information for (default: 3) -`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) -`type`:: -<> -- The type to sample (default: cpu) -Options::: - * `"cpu"` - * `"wait"` - * `"block"` - -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-nodes-info-5-3]] -=== `nodes.info` - -[source,js] --------- -client.nodes.info([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`timeout`:: -<> -- Explicit operation timeout -`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 -`metric`:: -<>, <>, <> -- A comma-separated list of metrics you wish returned. Leave empty to return all. - -link:#[back to top] - -[[api-nodes-stats-5-3]] -=== `nodes.stats` - -[source,js] --------- -client.nodes.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<> -- A comma-separated list of search groups for `search` index metric -`[level=node]`:: -<> -- Return indices stats aggregated at index, node or shard level -Options::: - * `"indices"` - * `"node"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`timeout`:: -<> -- Explicit operation timeout -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics -`indexMetric`:: -<>, <>, <> -- Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. -`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 - -link:#[back to top] - -[[api-snapshot-create-5-3]] -=== `snapshot.create` - -[source,js] --------- -client.snapshot.create([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-createrepository-5-3]] -=== `snapshot.createRepository` - -[source,js] --------- -client.snapshot.createRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`verify`:: -<> -- Whether to verify the repository after creation -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-delete-5-3]] -=== `snapshot.delete` - -[source,js] --------- -client.snapshot.delete([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-deleterepository-5-3]] -=== `snapshot.deleteRepository` - -[source,js] --------- -client.snapshot.deleteRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<>, <>, <> -- A comma-separated list of repository names -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-get-5-3]] -=== `snapshot.get` - -[source,js] --------- -client.snapshot.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-getrepository-5-3]] -=== `snapshot.getRepository` - -[source,js] --------- -client.snapshot.getRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`repository`:: -<>, <>, <> -- A comma-separated list of repository names - -link:#[back to top] - -[[api-snapshot-restore-5-3]] -=== `snapshot.restore` - -[source,js] --------- -client.snapshot.restore([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-status-5-3]] -=== `snapshot.status` - -[source,js] --------- -client.snapshot.status([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-verifyrepository-5-3]] -=== `snapshot.verifyRepository` - -[source,js] --------- -client.snapshot.verifyRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-cancel-5-3]] -=== `tasks.cancel` - -[source,js] --------- -client.tasks.cancel([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all. -`parentNode`:: -<> -- Cancel tasks with specified parent node. -`parentTask`:: -<> -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. -`taskId`:: -<> -- Cancel the task with specified task id (node_id:task_number) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-get-5-3]] -=== `tasks.get` - -[source,js] --------- -client.tasks.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`taskId`:: -<> -- Return the task with specified id (node_id:task_number) - -link:#[back to top] - -[[api-tasks-list-5-3]] -=== `tasks.list` - -[source,js] --------- -client.tasks.list([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`[groupBy=nodes]`:: -<> -- Group tasks by nodes or parent/child relationships -Options::: - * `"nodes"` - * `"parents"` - - -link:#[back to top] diff --git a/docs/api_methods_5_4.asciidoc b/docs/api_methods_5_4.asciidoc deleted file mode 100644 index d6f6f63c5..000000000 --- a/docs/api_methods_5_4.asciidoc +++ /dev/null @@ -1,5465 +0,0 @@ -[[api-reference-5-4]] -== 5.4 API - - -NOTE: At this time, you must opt into the 5.4 API by setting the `apiVersion` config parameter. - - -[[api-bulk-5-4]] -=== `bulk` - -[source,js] --------- -client.bulk([params, [callback]]) --------- - -Perform many index/delete operations in a single API call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform three operations in a single request -[source,js] ---------- -client.bulk({ - body: [ - // action description - { index: { _index: 'myindex', _type: 'mytype', _id: 1 } }, - // the document to index - { title: 'foo' }, - // action description - { update: { _index: 'myindex', _type: 'mytype', _id: 2 } }, - // the document to update - { doc: { title: 'foo' } }, - // action description - { delete: { _index: 'myindex', _type: 'mytype', _id: 3 } }, - // no document needed for this delete - ] -}, function (err, resp) { - // ... -}); ---------- - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- 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`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`type`:: -<> -- Default document type for items which don't provide one -`fields`:: -<>, <>, <> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request -`_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 -`_sourceExclude`:: -<>, <>, <> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -`_sourceInclude`:: -<>, <>, <> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`index`:: -<> -- Default index for items which don't provide one -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-clearscroll-5-4]] -=== `clearScroll` - -[source,js] --------- -client.clearScroll([params, [callback]]) --------- - -Clear the scroll request created by specifying the scroll parameter to search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`scrollId`:: -<>, <>, <> -- A comma-separated list of scroll IDs to clear -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-count-5-4]] -=== `count` - -[source,js] --------- -client.count([params, [callback]]) --------- - -Get the number of documents for the cluster, index, type, or a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-count.html[the elasticsearch docs] for more information pertaining to this method. - -.Get the number of all documents in the cluster -[source,js] ---------- -const { count } = await client.count(); ---------- - -.Get the number of documents in an index -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name' -}); ---------- - -.Get the number of documents matching a query -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name', - body: { - query: { - filtered: { - filter: { - terms: { - foo: ['bar'] - } - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`minScore`:: -<> -- Include only documents with a specific `_score` value in the result -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`index`:: -<>, <>, <> -- A comma-separated list of indices to restrict the results -`type`:: -<>, <>, <> -- A comma-separated list of types to restrict the results -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-count.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-countpercolate-5-4]] -=== `countPercolate` - -[source,js] --------- -client.countPercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to count percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to count percolate document into. Defaults to type. -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being count percolated. -`type`:: -<> -- The type of the document being count percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-create-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create a document -[source,js] ---------- -await client.create({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - published_at: '2013-01-01', - counter: 1 - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-delete-5-4]] -=== `delete` - -[source,js] --------- -client.delete([params, [callback]]) --------- - -Delete a typed JSON document from a specific index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. - -.Delete the document `/myindex/mytype/1` -[source,js] ---------- -await client.delete({ - index: 'myindex', - type: 'mytype', - id: '1' -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletebyquery-5-4]] -=== `deleteByQuery` - -[source,js] --------- -client.deleteByQuery([params, [callback]]) --------- - -Delete documents from one or more indices and one or more types based on a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -.Deleting documents with a simple query -[source,js] ---------- -await client.deleteByQuery({ - index: 'myindex', - q: 'test' -}); ---------- - -.Deleting documents using the Query DSL -[source,js] ---------- -await client.deleteByQuery({ - index: 'posts', - body: { - query: { - term: { published: false } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the delete-by-query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`[waitForCompletion=true]`:: -<> -- Should the request should block until the delete-by-query is complete. -`requestsPerSecond`:: -<> -- The throttle for this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletescript-5-4]] -=== `deleteScript` - -[source,js] --------- -client.deleteScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletetemplate-5-4]] -=== `deleteTemplate` - -[source,js] --------- -client.deleteTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-exists-5-4]] -=== `exists` - -[source,js] --------- -client.exists([params, [callback]]) --------- - -Returns a boolean indicating whether or not a given document exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Check that the document `/myindex/mytype/1` exist -[source,js] ---------- -const exists = await client.exists({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-existssource-5-4]] -=== `existsSource` - -[source,js] --------- -client.existsSource([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document; use `_all` to fetch the first document matching the ID across all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-explain-5-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. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-explain.html[the elasticsearch docs] for more information pertaining to this method. - -.See how a document is scored against a simple query -[source,js] ---------- -const response = await client.explain({ - // the document to test - index: 'myindex', - type: 'mytype', - id: '1', - - // the query to score it against - q: 'field:value' -}); ---------- - -.See how a document is scored against a query written in the Query DSL -[source,js] ---------- -const response = await client.explain({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - query: { - match: { title: 'test' } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzeWildcard`:: -<> -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -`analyzer`:: -<> -- The analyzer for the query string query -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The default field for query string query (default: _all) -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-fieldcaps-5-4]] -=== `fieldCaps` - -[source,js] --------- -client.fieldCaps([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-field-caps.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fields`:: -<>, <>, <> -- A comma-separated list of field names -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-field-caps.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-fieldstats-5-4]] -=== `fieldStats` - -[source,js] --------- -client.fieldStats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-field-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fields`:: -<>, <>, <> -- A comma-separated list of fields for to get field statistics for (min value, max value, and more) -`[level=cluster]`:: -<> -- Defines if field stats should be returned on a per index level or on a cluster wide level -Options::: - * `"indices"` - * `"cluster"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-field-stats.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-get-5-4]] -=== `get` - -[source,js] --------- -client.get([params, [callback]]) --------- - -Get a typed JSON document from the index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Get `/myindex/mytype/1` -[source,js] ---------- -const response = await client.get({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) - -link:#[back to top] - -[[api-getscript-5-4]] -=== `getScript` - -[source,js] --------- -client.getScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language - -link:#[back to top] - -[[api-getsource-5-4]] -=== `getSource` - -[source,js] --------- -client.getSource([params, [callback]]) --------- - -Get the source of a document by its index, type and id. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document; use `_all` to fetch the first document matching the ID across all types - -link:#[back to top] - -[[api-gettemplate-5-4]] -=== `getTemplate` - -[source,js] --------- -client.getTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID - -link:#[back to top] - -[[api-index-5-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 <>. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create or update a document -[source,js] ---------- -const response = await client.index({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -`[opType=index]`:: -<> -- Explicit operation type -Options::: - * `"index"` - * `"create"` - -`parent`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-info-5-4]] -=== `info` - -[source,js] --------- -client.info([params, [callback]]) --------- - -Get basic info from the current cluster. - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-mget-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. - -.An array of doc locations. Useful for getting documents from different indices. -[source,js] ---------- -const response = await client.mget({ - body: { - docs: [ - { _index: 'indexA', _type: 'typeA', _id: '1' }, - { _index: 'indexB', _type: 'typeB', _id: '1' }, - { _index: 'indexC', _type: 'typeC', _id: '1' } - ] - } -}); ---------- - -.An array of ids. You must also specify the `index` and `type` that apply to all of the ids. -[source,js] ---------- -const response = await client.mget({ - index: 'myindex', - type: 'mytype', - body: { - ids: [1, 2, 3] - } -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mpercolate-5-4]] -=== `mpercolate` - -[source,js] --------- -client.mpercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<> -- The index of the document being count percolated to use as default -`type`:: -<> -- The type of the document being percolated to use as default. -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearch-5-4]] -=== `msearch` - -[source,js] --------- -client.msearch([params, [callback]]) --------- - -Execute several search requests within the same request. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform multiple different searches, the body is made up of meta/data pairs -[source,js] ---------- -const response = await client.msearch({ - body: [ - // match all query, on all indices and types - {}, - { query: { match_all: {} } }, - - // query_string query, on index/mytype - { index: 'myindex', type: 'mytype' }, - { query: { query_string: { query: '"Test 1"' } } } - ] -}); ---------- - - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`maxConcurrentSearches`:: -<> -- Controls the maximum number of concurrent searches the multi search api will execute -`typedKeys`:: -<> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearchtemplate-5-4]] -=== `msearchTemplate` - -[source,js] --------- -client.msearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`typedKeys`:: -<> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mtermvectors-5-4]] -=== `mtermvectors` - -[source,js] --------- -client.mtermvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ids`:: -<>, <>, <> -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body -`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". -`[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". -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[positions=true]`:: -<> -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`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". -`routing`:: -<> -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`parent`:: -<> -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`realtime`:: -<> -- Specifies if requests are real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-percolate-5-4]] -=== `percolate` - -[source,js] --------- -client.percolate([params, [callback]]) --------- - -Match a document against registered percolator queries. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -.First, Register queries named “alert-1” and “alert-2” for the “myindex” index -[source,js] ---------- -await Promise.all([ - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-1', - body: { - // This query will be run against documents sent to percolate - query: { - query_string: { - query: 'foo' - } - } - } - }), - - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-2', - body: { - // This query will also be run against documents sent to percolate - query: { - query_string: { - query: 'bar' - } - } - } - }) -]); ---------- - -.Then you can send documents to learn which query `_percolator` queries they match -[source,js] ---------- -const response1 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo" - } - } -}); - -// response1 should look something like -// { -// total: 1, -// matches: [ { _index: 'myindex', _id: 'alert-1' } ] -// } - -const response2 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo Bar" - } - } -}); - -// response2 should look something like -// { -// total: 2, -// matches: [ -// { _index: 'myindex', _id: 'alert-1' }, -// { _index: 'myindex', _id: 'alert-2' } -// ] -// } ---------- - - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to percolate document into. Defaults to type. -`percolateRouting`:: -<> -- The routing value to use when percolating the existing document. -`percolatePreference`:: -<> -- Which shard to prefer when executing the percolate request. -`percolateFormat`:: -<> -- Return an array of matching query IDs instead of objects -Options::: - * `"ids"` - -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being percolated. -`type`:: -<> -- The type of the document being percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ping-5-4]] -=== `ping` - -[source,js] --------- -client.ping([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-putscript-5-4]] -=== `putScript` - -[source,js] --------- -client.putScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-puttemplate-5-4]] -=== `putTemplate` - -[source,js] --------- -client.putTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindex-5-4]] -=== `reindex` - -[source,js] --------- -client.reindex([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`[waitForCompletion=true]`:: -<> -- Should the request should block until the reindex is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindexrethrottle-5-4]] -=== `reindexRethrottle` - -[source,js] --------- -client.reindexRethrottle([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`requestsPerSecond`:: -<> -- The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. -`taskId`:: -<> -- The task id to rethrottle -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-rendersearchtemplate-5-4]] -=== `renderSearchTemplate` - -[source,js] --------- -client.renderSearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- The id of the stored search template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-scroll-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -.Collect every title in the index that contains the word "test" -[source,js] ---------- -const allTitles = []; -const responseQueue = []; - -// start things off by searching, setting a scroll timeout, and pushing -// our first response into the queue to be processed -await client.search({ - index: 'myindex', - scroll: '30s', // keep the search results "scrollable" for 30 seconds - source: ['title'], // filter the source to only include the title field - q: 'title:test' -}) - -while (responseQueue.length) { - const response = responseQueue.shift(); - - // collect the titles from this response - response.hits.hits.forEach(function (hit) { - allTitles.push(hit.fields.title); - }); - - // check to see if we have collected all of the titles - if (response.hits.total === allTitles.length) { - console.log('every "test" title', allTitles); - break - } - - // get the next response if there are more titles to fetch - responseQueue.push( - await client.scroll({ - scrollId: response._scroll_id, - scroll: '30s' - }) - ); -} ---------- - - - -*Params* - -[horizontal] -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`scrollId`:: -<> -- The scroll ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-search-5-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/danpaz/bodybuilder[bodybuilder] and https://github.com/sudo-suhas/elastic-builder[elastic-builder] can be used to make building query bodies easier. - - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Search with a simple query string query -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - q: 'title:test' -}); ---------- - -.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash` -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - body: { - query: { - match: { - title: 'test' - } - }, - facets: { - tags: { - terms: { - field: 'tags' - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return as part of a hit -`docvalueFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`suggestField`:: -<> -- Specify which field to use for suggestions -`[suggestMode=missing]`:: -<> -- Specify suggest mode -Options::: - * `"missing"` - * `"popular"` - * `"always"` - -`suggestSize`:: -<> -- How many suggestions to return in response -`suggestText`:: -<> -- The source text for which the suggestions should be returned -`timeout`:: -<> -- Explicit operation timeout -`trackScores`:: -<> -- Whether to calculate and return scores even if they are not used for sorting -`typedKeys`:: -<> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`[batchedReduceSize=512]`:: -<> -- The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchshards-5-4]] -=== `searchShards` - -[source,js] --------- -client.searchShards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-shards.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchtemplate-5-4]] -=== `searchTemplate` - -[source,js] --------- -client.searchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`profile`:: -<> -- Specify whether to profile the query execution -`typedKeys`:: -<> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-suggest-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-suggesters.html[the elasticsearch docs] for more information pertaining to this method. - -.Return query terms suggestions (“auto-correction”) -[source,js] ---------- -const response = await client.suggest({ - index: 'myindex', - body: { - mysuggester: { - text: 'tset', - term: { - field: 'title' - } - } - } -}); - -// response will be formatted like so: -// -// { -// ... -// mysuggester: [ -// { -// text: "tset", -// ... -// options: [ -// { -// text: "test", -// score: 0.75, -// freq: 5 -// } -// ] -// } -// ] -// } - ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-suggesters.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-termvectors-5-4]] -=== `termvectors` - -[source,js] --------- -client.termvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`termStatistics`:: -<> -- Specifies if total term frequency and document frequency should be returned. -`[fieldStatistics=true]`:: -<> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. -`[positions=true]`:: -<> -- Specifies if term positions should be returned. -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random). -`routing`:: -<> -- Specific routing value. -`parent`:: -<> -- Parent id of documents. -`realtime`:: -<> -- Specifies if request is real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`id`:: -<> -- The id of the document, when not specified a doc param should be supplied. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-update-5-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 - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update.html[the elasticsearch docs] for more information pertaining to this method. - -.Update document title using partial document -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - // put the partial document under the `doc` key - doc: { - title: 'Updated' - } - } -}) ---------- - -.Add a tag to document `tags` property using a `script` -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags += tag', - params: { tag: 'some new tag' } - } -}); ---------- - -.Increment a document counter by 1 or initialize it, when the document does not exist -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '777', - body: { - script: 'ctx._source.counter += 1', - upsert: { - counter: 1 - } - } -}) ---------- - -.Delete a document if it's tagged “to-delete” -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"', - params: { - tag: 'to-delete' - } - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<>, <>, <> -- A comma-separated list of fields to return in the response -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`lang`:: -<> -- The script language (default: painless) -`parent`:: -<> -- ID of the parent document. Is is only used for routing and when for the upsert request -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`retryOnConflict`:: -<> -- Specify how many times should the operation be retried when a conflict occurs (default: 0) -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"force"` - -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-updatebyquery-5-4]] -=== `updateByQuery` - -[source,js] --------- -client.updateByQuery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the update by query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`pipeline`:: -<> -- Ingest pipeline to set on index requests made by this action. (default: none) -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`versionType`:: -<> -- Should the document increment the version number (internal) on hit or not (reindex) -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`[waitForCompletion=true]`:: -<> -- Should the request should block until the update by query operation is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cat-aliases-5-4]] -=== `cat.aliases` - -[source,js] --------- -client.cat.aliases([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-cat-allocation-5-4]] -=== `cat.allocation` - -[source,js] --------- -client.cat.allocation([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`nodeId`:: -<>, <>, <> -- A comma-separated list of node IDs or names to limit the returned information - -link:#[back to top] - -[[api-cat-count-5-4]] -=== `cat.count` - -[source,js] --------- -client.cat.count([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-count.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-fielddata-5-4]] -=== `cat.fielddata` - -[source,js] --------- -client.cat.fielddata([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return the fielddata size - -link:#[back to top] - -[[api-cat-health-5-4]] -=== `cat.health` - -[source,js] --------- -client.cat.health([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`[ts=true]`:: -<> -- Set to false to disable timestamping -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-help-5-4]] -=== `cat.help` - -[source,js] --------- -client.cat.help([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by - -link:#[back to top] - -[[api-cat-indices-5-4]] -=== `cat.indices` - -[source,js] --------- -client.cat.indices([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"m"` - * `"g"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`health`:: -<> -- A health status ("green", "yellow", or "red" to filter only indices matching the specified health status -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`help`:: -<> -- Return help information -`pri`:: -<> -- Set to true to return stats only for primary shards -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-master-5-4]] -=== `cat.master` - -[source,js] --------- -client.cat.master([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-master.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodeattrs-5-4]] -=== `cat.nodeattrs` - -[source,js] --------- -client.cat.nodeattrs([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodes-5-4]] -=== `cat.nodes` - -[source,js] --------- -client.cat.nodes([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`fullId`:: -<> -- Return the full node ID instead of the shortened version (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-pendingtasks-5-4]] -=== `cat.pendingTasks` - -[source,js] --------- -client.cat.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-plugins-5-4]] -=== `cat.plugins` - -[source,js] --------- -client.cat.plugins([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-recovery-5-4]] -=== `cat.recovery` - -[source,js] --------- -client.cat.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-repositories-5-4]] -=== `cat.repositories` - -[source,js] --------- -client.cat.repositories([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-segments-5-4]] -=== `cat.segments` - -[source,js] --------- -client.cat.segments([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-shards-5-4]] -=== `cat.shards` - -[source,js] --------- -client.cat.shards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-snapshots-5-4]] -=== `cat.snapshots` - -[source,js] --------- -client.cat.snapshots([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`ignoreUnavailable`:: -<> -- Set to true to ignore unavailable snapshots -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`repository`:: -<>, <>, <> -- Name of repository from which to fetch the snapshot information - -link:#[back to top] - -[[api-cat-tasks-5-4]] -=== `cat.tasks` - -[source,js] --------- -client.cat.tasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id. Set to -1 to return all. -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-templates-5-4]] -=== `cat.templates` - -[source,js] --------- -client.cat.templates([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<> -- A pattern that returned template names must match - -link:#[back to top] - -[[api-cat-threadpool-5-4]] -=== `cat.threadPool` - -[source,js] --------- -client.cat.threadPool([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`size`:: -<> -- The multiplier in which to display values -Options::: - * `""` - * `"k"` - * `"m"` - * `"g"` - * `"t"` - * `"p"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`threadPoolPatterns`:: -<>, <>, <> -- A comma-separated list of regular-expressions to filter the thread pools in the output - -link:#[back to top] - -[[api-cluster-allocationexplain-5-4]] -=== `cluster.allocationExplain` - -[source,js] --------- -client.cluster.allocationExplain([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeYesDecisions`:: -<> -- Return 'YES' decisions in explanation (default: false) -`includeDiskInfo`:: -<> -- Return information about disk usage and shard sizes (default: false) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-getsettings-5-4]] -=== `cluster.getSettings` - -[source,js] --------- -client.cluster.getSettings([params, [callback]]) --------- - -Get cluster settings (previously set with `putSettings()`) - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`includeDefaults`:: -<> -- Whether to return all default clusters setting. - -link:#[back to top] - -[[api-cluster-health-5-4]] -=== `cluster.health` - -[source,js] --------- -client.cluster.health([params, [callback]]) --------- - -Get a very simple status on the health of the cluster. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`[level=cluster]`:: -<> -- Specify the level of detail for returned information -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`waitForActiveShards`:: -<> -- Wait until the specified number of shards is active -`waitForNodes`:: -<> -- Wait until the specified number of nodes is available -`waitForEvents`:: -<> -- Wait until all currently queued events with the given priority are processed -Options::: - * `"immediate"` - * `"urgent"` - * `"high"` - * `"normal"` - * `"low"` - * `"languid"` - -`waitForNoRelocatingShards`:: -<> -- Whether to wait until there are no relocating shards in the cluster -`waitForStatus`:: -<> -- Wait until cluster is in a specific state -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`index`:: -<>, <>, <> -- Limit the information returned to a specific index - -link:#[back to top] - -[[api-cluster-pendingtasks-5-4]] -=== `cluster.pendingTasks` - -[source,js] --------- -client.cluster.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master - -link:#[back to top] - -[[api-cluster-putsettings-5-4]] -=== `cluster.putSettings` - -[source,js] --------- -client.cluster.putSettings([params, [callback]]) --------- - -Update cluster wide specific settings. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-reroute-5-4]] -=== `cluster.reroute` - -[source,js] --------- -client.cluster.reroute([params, [callback]]) --------- - -Explicitly execute a cluster reroute allocation command including specific commands. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`dryRun`:: -<> -- Simulate the operation only and return the resulting state -`explain`:: -<> -- Return an explanation of why the commands can or cannot be executed -`retryFailed`:: -<> -- Retries allocation of shards that are blocked due to too many subsequent allocation failures -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics. Defaults to all but metadata -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-state-5-4]] -=== `cluster.state` - -[source,js] --------- -client.cluster.state([params, [callback]]) --------- - -Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics - -link:#[back to top] - -[[api-cluster-stats-5-4]] -=== `cluster.stats` - -[source,js] --------- -client.cluster.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-indices-analyze-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The name of the analyzer to use -`charFilter`:: -<>, <>, <> -- A comma-separated list of character filters to use for the analysis -`field`:: -<> -- Use the analyzer configured for this field (instead of passing the analyzer name) -`filter`:: -<>, <>, <> -- A comma-separated list of filters to use for the analysis -`index`:: -<> -- The name of the index to scope the operation -`preferLocal`:: -<> -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) -`text`:: -<>, <>, <> -- The text on which the analysis should be performed (when request body is not used) -`tokenizer`:: -<> -- The name of the tokenizer to use for the analysis -`explain`:: -<> -- With `true`, outputs more advanced details. (default: false) -`attributes`:: -<>, <>, <> -- A comma-separated list of token attributes to output, this parameter works only with `explain=true` -`[format=detailed]`:: -<> -- Format of the output -Options::: - * `"detailed"` - * `"text"` - -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-clearcache-5-4]] -=== `indices.clearCache` - -[source,js] --------- -client.indices.clearCache([params, [callback]]) --------- - -Clear either all caches or specific cached associated with one ore more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fieldData`:: -<> -- Clear field data -`fielddata`:: -<> -- Clear field data -`fields`:: -<>, <>, <> -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all) -`query`:: -<> -- Clear query caches -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index name to limit the operation -`recycler`:: -<> -- Clear the recycler cache -`requestCache`:: -<> -- Clear request cache -`request`:: -<> -- Clear request cache -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-close-5-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. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to close -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-create-5-4]] -=== `indices.create` - -[source,js] --------- -client.indices.create([params, [callback]]) --------- - -Create an index in Elasticsearch. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for before the operation returns. -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`index`:: -<> -- The name of the index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-delete-5-4]] -=== `indices.delete` - -[source,js] --------- -client.indices.delete([params, [callback]]) --------- - -Delete an index in Elasticsearch - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletealias-5-4]] -=== `indices.deleteAlias` - -[source,js] --------- -client.indices.deleteAlias([params, [callback]]) --------- - -Delete a specific alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names (supports wildcards); use `_all` for all indices -`name`:: -<>, <>, <> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletetemplate-5-4]] -=== `indices.deleteTemplate` - -[source,js] --------- -client.indices.deleteTemplate([params, [callback]]) --------- - -Delete an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-exists-5-4]] -=== `indices.exists` - -[source,js] --------- -client.indices.exists([params, [callback]]) --------- - -Return a boolean indicating whether given index exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Ignore unavailable indexes (default: false) -`allowNoIndices`:: -<> -- Ignore if a wildcard expression resolves to no concrete indices (default: false) -`[expandWildcards=open]`:: -<> -- Whether wildcard expressions should get expanded to open or closed indices (default: open) -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existsalias-5-4]] -=== `indices.existsAlias` - -[source,js] --------- -client.indices.existsAlias([params, [callback]]) --------- - -Return a boolean indicating whether given alias exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=all]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstemplate-5-4]] -=== `indices.existsTemplate` - -[source,js] --------- -client.indices.existsTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<>, <>, <> -- The comma separated names of the index templates -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstype-5-4]] -=== `indices.existsType` - -[source,js] --------- -client.indices.existsType([params, [callback]]) --------- - -Check if a type/types exists in an index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` to check the types across all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flush-5-4]] -=== `indices.flush` - -[source,js] --------- -client.indices.flush([params, [callback]]) --------- - -Explicitly flush one or more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`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. -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flushsynced-5-4]] -=== `indices.flushSynced` - -[source,js] --------- -client.indices.flushSynced([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-forcemerge-5-4]] -=== `indices.forcemerge` - -[source,js] --------- -client.indices.forcemerge([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flush`:: -<> -- Specify whether the index should be flushed after performing the operation (default: true) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`maxNumSegments`:: -<> -- The number of segments the index should be merged into (default: dynamic) -`onlyExpungeDeletes`:: -<> -- Specify whether the operation should only expunge deleted documents -`operationThreading`:: -anything -- TODO: ? -`waitForMerge`:: -<> -- Specify whether the request should block until the merge process is finished (default: true) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-get-5-4]] -=== `indices.get` - -[source,js] --------- -client.indices.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Ignore unavailable indexes (default: false) -`allowNoIndices`:: -<> -- Ignore if a wildcard expression resolves to no concrete indices (default: false) -`[expandWildcards=open]`:: -<> -- Whether wildcard expressions should get expanded to open or closed indices (default: open) -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names -`feature`:: -<>, <>, <> -- A comma-separated list of features - -link:#[back to top] - -[[api-indices-getalias-5-4]] -=== `indices.getAlias` - -[source,js] --------- -client.indices.getAlias([params, [callback]]) --------- - -Retrieve a specified alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=all]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-indices-getfieldmapping-5-4]] -=== `indices.getFieldMapping` - -[source,js] --------- -client.indices.getFieldMapping([params, [callback]]) --------- - -Retrieve mapping definition of a specific field. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeDefaults`:: -<> -- Whether the default mapping values should be returned as well -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types -`fields`:: -<>, <>, <> -- A comma-separated list of fields - -link:#[back to top] - -[[api-indices-getmapping-5-4]] -=== `indices.getMapping` - -[source,js] --------- -client.indices.getMapping([params, [callback]]) --------- - -Retrieve mapping definition of index or index/type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types - -link:#[back to top] - -[[api-indices-getsettings-5-4]] -=== `indices.getSettings` - -[source,js] --------- -client.indices.getSettings([params, [callback]]) --------- - -Retrieve settings for one or more (or all) indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`name`:: -<>, <>, <> -- The name of the settings that should be included - -link:#[back to top] - -[[api-indices-gettemplate-5-4]] -=== `indices.getTemplate` - -[source,js] --------- -client.indices.getTemplate([params, [callback]]) --------- - -Retrieve an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<>, <>, <> -- The comma separated names of the index templates - -link:#[back to top] - -[[api-indices-getupgrade-5-4]] -=== `indices.getUpgrade` - -[source,js] --------- -client.indices.getUpgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-open-5-4]] -=== `indices.open` - -[source,js] --------- -client.indices.open([params, [callback]]) --------- - -Open a closed index, making it available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to open -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putalias-5-4]] -=== `indices.putAlias` - -[source,js] --------- -client.indices.putAlias([params, [callback]]) --------- - -Create an alias for a specific index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -`name`:: -<> -- The name of the alias to be created or updated -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putmapping-5-4]] -=== `indices.putMapping` - -[source,js] --------- -client.indices.putMapping([params, [callback]]) --------- - -Register specific mapping definition for a specific type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`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. -`type`:: -<> -- The name of the document type -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putsettings-5-4]] -=== `indices.putSettings` - -[source,js] --------- -client.indices.putSettings([params, [callback]]) --------- - -Change specific index level settings in real time. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Specify timeout for connection to master -`preserveExisting`:: -<> -- Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-puttemplate-5-4]] -=== `indices.putTemplate` - -[source,js] --------- -client.indices.putTemplate([params, [callback]]) --------- - -Create an index template that will automatically be applied to new indices created. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`order`:: -<> -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) -`create`:: -<> -- Whether the index template should only be added if new or can also replace an existing one -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-recovery-5-4]] -=== `indices.recovery` - -[source,js] --------- -client.indices.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`detailed`:: -<> -- Whether to display detailed information about shard recovery -`activeOnly`:: -<> -- Display only those recoveries that are currently on-going -`index`:: -<>, <>, <> -- 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-5-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. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-rollover-5-4]] -=== `indices.rollover` - -[source,js] --------- -client.indices.rollover([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`dryRun`:: -<> -- If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the newly created rollover index before the operation returns. -`alias`:: -<> -- The name of the alias to rollover -`newIndex`:: -<> -- The name of the rollover index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-segments-5-4]] -=== `indices.segments` - -[source,js] --------- -client.indices.segments([params, [callback]]) --------- - -Retrieve low level segments information that a Lucene index (shard level) is built with. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`verbose`:: -<> -- Includes detailed memory usage by Lucene. -`index`:: -<>, <>, <> -- 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-5-4]] -=== `indices.shardStores` - -[source,js] --------- -client.indices.shardStores([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`status`:: -<>, <>, <> -- A comma-separated list of statuses used to filter on shards to get store information for -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-shrink-5-4]] -=== `indices.shrink` - -[source,js] --------- -client.indices.shrink([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the shrunken index before the operation returns. -`index`:: -<> -- The name of the source index to shrink -`target`:: -<> -- The name of the target index to shrink into -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-stats-5-4]] -=== `indices.stats` - -[source,js] --------- -client.indices.stats([params, [callback]]) --------- - -Retrieve statistics on different operations happening on an index. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<>, <>, <> -- A comma-separated list of search groups for `search` index metric -`[level=indices]`:: -<> -- Return stats aggregated at cluster, index or shard level -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned the specific metrics. - -link:#[back to top] - -[[api-indices-updatealiases-5-4]] -=== `indices.updateAliases` - -[source,js] --------- -client.indices.updateAliases([params, [callback]]) --------- - -Update specified aliases. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform an atomic alias swap, for a rotating index -[source,js] ---------- -const response = await client.indices.updateAliases({ - body: { - actions: [ - { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } }, - { add: { index: 'logstash-2014.05', alias: 'logstash-current' } } - ] - } -}); ---------- - - - -*Params* - -[horizontal] -`timeout`:: -<> -- Request timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-upgrade-5-4]] -=== `indices.upgrade` - -[source,js] --------- -client.indices.upgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`waitForCompletion`:: -<> -- Specify whether the request should block until the all segments are upgraded (default: false) -`onlyAncientSegments`:: -<> -- If true, only ancient (an older Lucene major release) segments will be upgraded -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-validatequery-5-4]] -=== `indices.validateQuery` - -[source,js] --------- -client.indices.validateQuery([params, [callback]]) --------- - -Validate a potentially expensive query without executing it. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-validate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`explain`:: -<> -- Return detailed information about the error -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`rewrite`:: -<> -- Provide a more detailed explanation showing the actual Lucene query that will be executed. -`allShards`:: -<> -- Execute validation on all shards instead of one random shard per index -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-validate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-deletepipeline-5-4]] -=== `ingest.deletePipeline` - -[source,js] --------- -client.ingest.deletePipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-getpipeline-5-4]] -=== `ingest.getPipeline` - -[source,js] --------- -client.ingest.getPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`id`:: -<> -- Comma separated list of pipeline ids. Wildcards supported - -link:#[back to top] - -[[api-ingest-putpipeline-5-4]] -=== `ingest.putPipeline` - -[source,js] --------- -client.ingest.putPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-simulate-5-4]] -=== `ingest.simulate` - -[source,js] --------- -client.ingest.simulate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`verbose`:: -<> -- Verbose mode. Display data output for each processor in executed pipeline -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-nodes-hotthreads-5-4]] -=== `nodes.hotThreads` - -[source,js] --------- -client.nodes.hotThreads([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`interval`:: -<> -- The interval for the second sampling of threads -`snapshots`:: -<> -- Number of samples of thread stacktrace (default: 10) -`threads`:: -<> -- Specify the number of threads to provide information for (default: 3) -`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) -`type`:: -<> -- The type to sample (default: cpu) -Options::: - * `"cpu"` - * `"wait"` - * `"block"` - -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-nodes-info-5-4]] -=== `nodes.info` - -[source,js] --------- -client.nodes.info([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`timeout`:: -<> -- Explicit operation timeout -`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 -`metric`:: -<>, <>, <> -- A comma-separated list of metrics you wish returned. Leave empty to return all. - -link:#[back to top] - -[[api-nodes-stats-5-4]] -=== `nodes.stats` - -[source,js] --------- -client.nodes.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<> -- A comma-separated list of search groups for `search` index metric -`[level=node]`:: -<> -- Return indices stats aggregated at index, node or shard level -Options::: - * `"indices"` - * `"node"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`timeout`:: -<> -- Explicit operation timeout -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics -`indexMetric`:: -<>, <>, <> -- Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. -`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 - -link:#[back to top] - -[[api-remote-info-5-4]] -=== `remote.info` - -[source,js] --------- -client.remote.info([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-remote-info.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-snapshot-create-5-4]] -=== `snapshot.create` - -[source,js] --------- -client.snapshot.create([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-createrepository-5-4]] -=== `snapshot.createRepository` - -[source,js] --------- -client.snapshot.createRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`verify`:: -<> -- Whether to verify the repository after creation -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-delete-5-4]] -=== `snapshot.delete` - -[source,js] --------- -client.snapshot.delete([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-deleterepository-5-4]] -=== `snapshot.deleteRepository` - -[source,js] --------- -client.snapshot.deleteRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<>, <>, <> -- A comma-separated list of repository names -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-get-5-4]] -=== `snapshot.get` - -[source,js] --------- -client.snapshot.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-getrepository-5-4]] -=== `snapshot.getRepository` - -[source,js] --------- -client.snapshot.getRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`repository`:: -<>, <>, <> -- A comma-separated list of repository names - -link:#[back to top] - -[[api-snapshot-restore-5-4]] -=== `snapshot.restore` - -[source,js] --------- -client.snapshot.restore([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-status-5-4]] -=== `snapshot.status` - -[source,js] --------- -client.snapshot.status([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-verifyrepository-5-4]] -=== `snapshot.verifyRepository` - -[source,js] --------- -client.snapshot.verifyRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-cancel-5-4]] -=== `tasks.cancel` - -[source,js] --------- -client.tasks.cancel([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all. -`parentNode`:: -<> -- Cancel tasks with specified parent node. -`parentTask`:: -<> -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. -`taskId`:: -<> -- Cancel the task with specified task id (node_id:task_number) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-get-5-4]] -=== `tasks.get` - -[source,js] --------- -client.tasks.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`taskId`:: -<> -- Return the task with specified id (node_id:task_number) - -link:#[back to top] - -[[api-tasks-list-5-4]] -=== `tasks.list` - -[source,js] --------- -client.tasks.list([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`[groupBy=nodes]`:: -<> -- Group tasks by nodes or parent/child relationships -Options::: - * `"nodes"` - * `"parents"` - - -link:#[back to top] diff --git a/docs/api_methods_5_5.asciidoc b/docs/api_methods_5_5.asciidoc deleted file mode 100644 index 537dc03d1..000000000 --- a/docs/api_methods_5_5.asciidoc +++ /dev/null @@ -1,5469 +0,0 @@ -[[api-reference-5-5]] -== 5.5 API - - -NOTE: At this time, you must opt into the 5.5 API by setting the `apiVersion` config parameter. - - -[[api-bulk-5-5]] -=== `bulk` - -[source,js] --------- -client.bulk([params, [callback]]) --------- - -Perform many index/delete operations in a single API call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform three operations in a single request -[source,js] ---------- -client.bulk({ - body: [ - // action description - { index: { _index: 'myindex', _type: 'mytype', _id: 1 } }, - // the document to index - { title: 'foo' }, - // action description - { update: { _index: 'myindex', _type: 'mytype', _id: 2 } }, - // the document to update - { doc: { title: 'foo' } }, - // action description - { delete: { _index: 'myindex', _type: 'mytype', _id: 3 } }, - // no document needed for this delete - ] -}, function (err, resp) { - // ... -}); ---------- - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- 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`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`type`:: -<> -- Default document type for items which don't provide one -`fields`:: -<>, <>, <> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request -`_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 -`_sourceExclude`:: -<>, <>, <> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -`_sourceInclude`:: -<>, <>, <> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`index`:: -<> -- Default index for items which don't provide one -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-clearscroll-5-5]] -=== `clearScroll` - -[source,js] --------- -client.clearScroll([params, [callback]]) --------- - -Clear the scroll request created by specifying the scroll parameter to search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`scrollId`:: -<>, <>, <> -- A comma-separated list of scroll IDs to clear -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-count-5-5]] -=== `count` - -[source,js] --------- -client.count([params, [callback]]) --------- - -Get the number of documents for the cluster, index, type, or a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-count.html[the elasticsearch docs] for more information pertaining to this method. - -.Get the number of all documents in the cluster -[source,js] ---------- -const { count } = await client.count(); ---------- - -.Get the number of documents in an index -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name' -}); ---------- - -.Get the number of documents matching a query -[source,js] ---------- -const { count } = await client.count({ - index: 'index_name', - body: { - query: { - filtered: { - filter: { - terms: { - foo: ['bar'] - } - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`minScore`:: -<> -- Include only documents with a specific `_score` value in the result -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`index`:: -<>, <>, <> -- A comma-separated list of indices to restrict the results -`type`:: -<>, <>, <> -- A comma-separated list of types to restrict the results -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-count.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-countpercolate-5-5]] -=== `countPercolate` - -[source,js] --------- -client.countPercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to count percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to count percolate document into. Defaults to type. -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being count percolated. -`type`:: -<> -- The type of the document being count percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-create-5-5]] -=== `create` - -[source,js] --------- -client.create([params, [callback]]) --------- - -Adds a typed JSON document in a specific index, making it searchable. If a document with the same `index`, `type`, and `id` already exists, an error will occur. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create a document -[source,js] ---------- -await client.create({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - published_at: '2013-01-01', - counter: 1 - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-delete-5-5]] -=== `delete` - -[source,js] --------- -client.delete([params, [callback]]) --------- - -Delete a typed JSON document from a specific index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. - -.Delete the document `/myindex/mytype/1` -[source,js] ---------- -await client.delete({ - index: 'myindex', - type: 'mytype', - id: '1' -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<> -- ID of parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-delete.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletebyquery-5-5]] -=== `deleteByQuery` - -[source,js] --------- -client.deleteByQuery([params, [callback]]) --------- - -Delete documents from one or more indices and one or more types based on a query. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -.Deleting documents with a simple query -[source,js] ---------- -await client.deleteByQuery({ - index: 'myindex', - q: 'test' -}); ---------- - -.Deleting documents using the Query DSL -[source,js] ---------- -await client.deleteByQuery({ - index: 'posts', - body: { - query: { - term: { published: false } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the delete-by-query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`[waitForCompletion=true]`:: -<> -- Should the request should block until the delete-by-query is complete. -`requestsPerSecond`:: -<> -- The throttle for this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletescript-5-5]] -=== `deleteScript` - -[source,js] --------- -client.deleteScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-deletetemplate-5-5]] -=== `deleteTemplate` - -[source,js] --------- -client.deleteTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-exists-5-5]] -=== `exists` - -[source,js] --------- -client.exists([params, [callback]]) --------- - -Returns a boolean indicating whether or not a given document exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Check that the document `/myindex/mytype/1` exist -[source,js] ---------- -const exists = await client.exists({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-existssource-5-5]] -=== `existsSource` - -[source,js] --------- -client.existsSource([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document; use `_all` to fetch the first document matching the ID across all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-explain-5-5]] -=== `explain` - -[source,js] --------- -client.explain([params, [callback]]) --------- - -Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-explain.html[the elasticsearch docs] for more information pertaining to this method. - -.See how a document is scored against a simple query -[source,js] ---------- -const response = await client.explain({ - // the document to test - index: 'myindex', - type: 'mytype', - id: '1', - - // the query to score it against - q: 'field:value' -}); ---------- - -.See how a document is scored against a query written in the Query DSL -[source,js] ---------- -const response = await client.explain({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - query: { - match: { title: 'test' } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzeWildcard`:: -<> -- Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -`analyzer`:: -<> -- The analyzer for the query string query -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The default field for query string query (default: _all) -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-fieldcaps-5-5]] -=== `fieldCaps` - -[source,js] --------- -client.fieldCaps([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-caps.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fields`:: -<>, <>, <> -- A comma-separated list of field names -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-caps.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-fieldstats-5-5]] -=== `fieldStats` - -[source,js] --------- -client.fieldStats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fields`:: -<>, <>, <> -- A comma-separated list of fields for to get field statistics for (min value, max value, and more) -`[level=cluster]`:: -<> -- Defines if field stats should be returned on a per index level or on a cluster wide level -Options::: - * `"indices"` - * `"cluster"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-stats.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-get-5-5]] -=== `get` - -[source,js] --------- -client.get([params, [callback]]) --------- - -Get a typed JSON document from the index based on its id. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -.Get `/myindex/mytype/1` -[source,js] ---------- -const response = await client.get({ - index: 'myindex', - type: 'mytype', - id: 1 -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) - -link:#[back to top] - -[[api-getscript-5-5]] -=== `getScript` - -[source,js] --------- -client.getScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language - -link:#[back to top] - -[[api-getsource-5-5]] -=== `getSource` - -[source,js] --------- -client.getSource([params, [callback]]) --------- - -Get the source of a document by its index, type and id. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`parent`:: -<> -- The ID of the parent document -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`id`:: -<> -- The document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document; use `_all` to fetch the first document matching the ID across all types - -link:#[back to top] - -[[api-gettemplate-5-5]] -=== `getTemplate` - -[source,js] --------- -client.getTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID - -link:#[back to top] - -[[api-index-5-5]] -=== `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 <>. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. - -.Create or update a document -[source,js] ---------- -const response = await client.index({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - title: 'Test 1', - tags: ['y', 'z'], - published: true, - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -`[opType=index]`:: -<> -- Explicit operation type -Options::: - * `"index"` - * `"create"` - -`parent`:: -<> -- ID of the parent document -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`pipeline`:: -<> -- The pipeline id to preprocess incoming documents with -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-index_.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-info-5-5]] -=== `info` - -[source,js] --------- -client.info([params, [callback]]) --------- - -Get basic info from the current cluster. - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-mget-5-5]] -=== `mget` - -[source,js] --------- -client.mget([params, [callback]]) --------- - -Get multiple documents based on an index, type (optional) and ids. The body required by mget can take two forms: an array of document locations, or an array of document ids. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. - -.An array of doc locations. Useful for getting documents from different indices. -[source,js] ---------- -const response = await client.mget({ - body: { - docs: [ - { _index: 'indexA', _type: 'typeA', _id: '1' }, - { _index: 'indexB', _type: 'typeB', _id: '1' }, - { _index: 'indexC', _type: 'typeC', _id: '1' } - ] - } -}); ---------- - -.An array of ids. You must also specify the `index` and `type` that apply to all of the ids. -[source,js] ---------- -const response = await client.mget({ - index: 'myindex', - type: 'mytype', - body: { - ids: [1, 2, 3] - } -}); ---------- - - - -*Params* - -[horizontal] -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return in the response -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`realtime`:: -<> -- Specify whether to perform the operation in realtime or search mode -`refresh`:: -<> -- Refresh the shard containing the document before performing the operation -`routing`:: -<> -- Specific routing value -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mpercolate-5-5]] -=== `mpercolate` - -[source,js] --------- -client.mpercolate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<> -- The index of the document being count percolated to use as default -`type`:: -<> -- The type of the document being percolated to use as default. -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearch-5-5]] -=== `msearch` - -[source,js] --------- -client.msearch([params, [callback]]) --------- - -Execute several search requests within the same request. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform multiple different searches, the body is made up of meta/data pairs -[source,js] ---------- -const response = await client.msearch({ - body: [ - // match all query, on all indices and types - {}, - { query: { match_all: {} } }, - - // query_string query, on index/mytype - { index: 'myindex', type: 'mytype' }, - { query: { query_string: { query: '"Test 1"' } } } - ] -}); ---------- - - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`maxConcurrentSearches`:: -<> -- Controls the maximum number of concurrent searches the multi search api will execute -`typedKeys`:: -<> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-msearchtemplate-5-5]] -=== `msearchTemplate` - -[source,js] --------- -client.msearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`typedKeys`:: -<> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`maxConcurrentSearches`:: -<> -- Controls the maximum number of concurrent searches the multi search api will execute -`index`:: -<>, <>, <> -- A comma-separated list of index names to use as default -`type`:: -<>, <>, <> -- A comma-separated list of document types to use as default -`body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-mtermvectors-5-5]] -=== `mtermvectors` - -[source,js] --------- -client.mtermvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ids`:: -<>, <>, <> -- A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body -`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". -`[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". -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[positions=true]`:: -<> -- Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`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". -`routing`:: -<> -- Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`parent`:: -<> -- Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". -`realtime`:: -<> -- Specifies if requests are real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-percolate-5-5]] -=== `percolate` - -[source,js] --------- -client.percolate([params, [callback]]) --------- - -Match a document against registered percolator queries. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html[the elasticsearch docs] for more information pertaining to this method. - -.First, Register queries named “alert-1” and “alert-2” for the “myindex” index -[source,js] ---------- -await Promise.all([ - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-1', - body: { - // This query will be run against documents sent to percolate - query: { - query_string: { - query: 'foo' - } - } - } - }), - - client.index({ - index: 'myindex', - type: '.percolator', - id: 'alert-2', - body: { - // This query will also be run against documents sent to percolate - query: { - query_string: { - query: 'bar' - } - } - } - }) -]); ---------- - -.Then you can send documents to learn which query `_percolator` queries they match -[source,js] ---------- -const response1 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo" - } - } -}); - -// response1 should look something like -// { -// total: 1, -// matches: [ { _index: 'myindex', _id: 'alert-1' } ] -// } - -const response2 = await client.percolate({ - index: 'myindex', - type: 'mytype', - body: { - doc: { - title: "Foo Bar" - } - } -}); - -// response2 should look something like -// { -// total: 2, -// matches: [ -// { _index: 'myindex', _id: 'alert-1' }, -// { _index: 'myindex', _id: 'alert-2' } -// ] -// } ---------- - - - -*Params* - -[horizontal] -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`percolateIndex`:: -<> -- The index to percolate the document into. Defaults to index. -`percolateType`:: -<> -- The type to percolate document into. Defaults to type. -`percolateRouting`:: -<> -- The routing value to use when percolating the existing document. -`percolatePreference`:: -<> -- Which shard to prefer when executing the percolate request. -`percolateFormat`:: -<> -- Return an array of matching query IDs instead of objects -Options::: - * `"ids"` - -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index of the document being percolated. -`type`:: -<> -- The type of the document being percolated. -`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. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ping-5-5]] -=== `ping` - -[source,js] --------- -client.ping([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-putscript-5-5]] -=== `putScript` - -[source,js] --------- -client.putScript([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Script ID -`lang`:: -<> -- Script language -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-puttemplate-5-5]] -=== `putTemplate` - -[source,js] --------- -client.putTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- Template ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindex-5-5]] -=== `reindex` - -[source,js] --------- -client.reindex([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`[waitForCompletion=true]`:: -<> -- Should the request should block until the reindex is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-reindexrethrottle-5-5]] -=== `reindexRethrottle` - -[source,js] --------- -client.reindexRethrottle([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`requestsPerSecond`:: -<> -- The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. -`taskId`:: -<> -- The task id to rethrottle -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-rendersearchtemplate-5-5]] -=== `renderSearchTemplate` - -[source,js] --------- -client.renderSearchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`id`:: -<> -- The id of the stored search template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-scroll-5-5]] -=== `scroll` - -[source,js] --------- -client.scroll([params, [callback]]) --------- - -Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. - -.Collect every title in the index that contains the word "test" -[source,js] ---------- -const allTitles = []; -const responseQueue = []; - -// start things off by searching, setting a scroll timeout, and pushing -// our first response into the queue to be processed -await client.search({ - index: 'myindex', - scroll: '30s', // keep the search results "scrollable" for 30 seconds - source: ['title'], // filter the source to only include the title field - q: 'title:test' -}) - -while (responseQueue.length) { - const response = responseQueue.shift(); - - // collect the titles from this response - response.hits.hits.forEach(function (hit) { - allTitles.push(hit.fields.title); - }); - - // check to see if we have collected all of the titles - if (response.hits.total === allTitles.length) { - console.log('every "test" title', allTitles); - break - } - - // get the next response if there are more titles to fetch - responseQueue.push( - await client.scroll({ - scrollId: response._scroll_id, - scroll: '30s' - }) - ); -} ---------- - - - -*Params* - -[horizontal] -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`scrollId`:: -<> -- The scroll ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-search-5-5]] -=== `search` - -[source,js] --------- -client.search([params, [callback]]) --------- - -Return documents matching a query, aggregations/facets, highlighted snippets, suggestions, and more. Write your queries as either http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-uri-request.html[simple query strings] in the `q` parameter, or by specifying a http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html[full request definition] using the http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html[Elasticsearch Query DSL] in the `body` parameter. - -TIP: https://github.com/danpaz/bodybuilder[bodybuilder] and https://github.com/sudo-suhas/elastic-builder[elastic-builder] can be used to make building query bodies easier. - - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-search.html[the elasticsearch docs] for more information pertaining to this method. - -.Search with a simple query string query -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - q: 'title:test' -}); ---------- - -.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash` -[source,js] ---------- -const response = await client.search({ - index: 'myindex', - body: { - query: { - match: { - title: 'test' - } - }, - facets: { - tags: { - terms: { - field: 'tags' - } - } - } - } -}); ---------- - - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`storedFields`:: -<>, <>, <> -- A comma-separated list of stored fields to return as part of a hit -`docvalueFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields to return as the docvalue representation of a field for each hit -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`suggestField`:: -<> -- Specify which field to use for suggestions -`[suggestMode=missing]`:: -<> -- Specify suggest mode -Options::: - * `"missing"` - * `"popular"` - * `"always"` - -`suggestSize`:: -<> -- How many suggestions to return in response -`suggestText`:: -<> -- The source text for which the suggestions should be returned -`timeout`:: -<> -- Explicit operation timeout -`trackScores`:: -<> -- Whether to calculate and return scores even if they are not used for sorting -`typedKeys`:: -<> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`version`:: -<> -- Specify whether to return document version as part of a hit -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`[batchedReduceSize=512]`:: -<> -- The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-search.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchshards-5-5]] -=== `searchShards` - -[source,js] --------- -client.searchShards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-shards.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-searchtemplate-5-5]] -=== `searchTemplate` - -[source,js] --------- -client.searchTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"query_and_fetch"` - * `"dfs_query_then_fetch"` - * `"dfs_query_and_fetch"` - -`explain`:: -<> -- Specify whether to return detailed information about score computation as part of a hit -`profile`:: -<> -- Specify whether to profile the query execution -`typedKeys`:: -<> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-suggest-5-5]] -=== `suggest` - -[source,js] --------- -client.suggest([params, [callback]]) --------- - -The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-suggesters.html[the elasticsearch docs] for more information pertaining to this method. - -.Return query terms suggestions (“auto-correction”) -[source,js] ---------- -const response = await client.suggest({ - index: 'myindex', - body: { - mysuggester: { - text: 'tset', - term: { - field: 'title' - } - } - } -}); - -// response will be formatted like so: -// -// { -// ... -// mysuggester: [ -// { -// text: "tset", -// ... -// options: [ -// { -// text: "test", -// score: 0.75, -// freq: 5 -// } -// ] -// } -// ] -// } - ---------- - - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`routing`:: -<> -- Specific routing value -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-suggesters.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-termvectors-5-5]] -=== `termvectors` - -[source,js] --------- -client.termvectors([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`termStatistics`:: -<> -- Specifies if total term frequency and document frequency should be returned. -`[fieldStatistics=true]`:: -<> -- Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return. -`[offsets=true]`:: -<> -- Specifies if term offsets should be returned. -`[positions=true]`:: -<> -- Specifies if term positions should be returned. -`[payloads=true]`:: -<> -- Specifies if term payloads should be returned. -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random). -`routing`:: -<> -- Specific routing value. -`parent`:: -<> -- Parent id of documents. -`realtime`:: -<> -- Specifies if request is real-time as opposed to near-real-time (default: true). -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"external"` - * `"external_gte"` - * `"force"` - -`index`:: -<> -- The index in which the document resides. -`type`:: -<> -- The type of the document. -`id`:: -<> -- The id of the document, when not specified a doc param should be supplied. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-update-5-5]] -=== `update` - -[source,js] --------- -client.update([params, [callback]]) --------- - -Update parts of a document. The required body parameter can contain one of two things: - - * a partial document, which will be merged with the existing one. - * a `script` which will update the document content - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-update.html[the elasticsearch docs] for more information pertaining to this method. - -.Update document title using partial document -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - // put the partial document under the `doc` key - doc: { - title: 'Updated' - } - } -}) ---------- - -.Add a tag to document `tags` property using a `script` -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags += tag', - params: { tag: 'some new tag' } - } -}); ---------- - -.Increment a document counter by 1 or initialize it, when the document does not exist -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '777', - body: { - script: 'ctx._source.counter += 1', - upsert: { - counter: 1 - } - } -}) ---------- - -.Delete a document if it's tagged “to-delete” -[source,js] ---------- -const response = await client.update({ - index: 'myindex', - type: 'mytype', - id: '1', - body: { - script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"', - params: { - tag: 'to-delete' - } - } -}); ---------- - - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- 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`:: -<>, <>, <> -- A comma-separated list of fields to return in the response -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`lang`:: -<> -- The script language (default: painless) -`parent`:: -<> -- ID of the parent document. Is is only used for routing and when for the upsert request -`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. -Options::: - * `"true"` - * `"false"` - * `"wait_for"` - * `""` - -`retryOnConflict`:: -<> -- Specify how many times should the operation be retried when a conflict occurs (default: 0) -`routing`:: -<> -- Specific routing value -`timeout`:: -<> -- Explicit operation timeout -`timestamp`:: -Timestamp -- Explicit timestamp for the document -`ttl`:: -<> -- Expiration time for the document -`version`:: -<> -- Explicit version number for concurrency control -`versionType`:: -<> -- Specific version type -Options::: - * `"internal"` - * `"force"` - -`id`:: -<> -- Document ID -`index`:: -<> -- The name of the index -`type`:: -<> -- The type of the document -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-update.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-updatebyquery-5-5]] -=== `updateByQuery` - -[source,js] --------- -client.updateByQuery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`from`:: -<> -- Starting offset (default: 0) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[conflicts=abort]`:: -<> -- What to do when the update by query hits version conflicts? -Options::: - * `"abort"` - * `"proceed"` - -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`pipeline`:: -<> -- Ingest pipeline to set on index requests made by this action. (default: none) -`preference`:: -<> -- Specify the node or shard the operation should be performed on (default: random) -`q`:: -<> -- Query in the Lucene query string syntax -`routing`:: -<>, <>, <> -- A comma-separated list of specific routing values -`scroll`:: -<> -- Specify how long a consistent view of the index should be maintained for scrolled search -`searchType`:: -<> -- Search operation type -Options::: - * `"query_then_fetch"` - * `"dfs_query_then_fetch"` - -`searchTimeout`:: -<> -- Explicit timeout for each search request. Defaults to no timeout. -`size`:: -<> -- Number of hits to return (default: 10) -`sort`:: -<>, <>, <> -- A comma-separated list of : pairs -`_source`:: -<>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExclude`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceInclude`:: -<>, <>, <> -- A list of fields to extract and return from the _source field -`terminateAfter`:: -<> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -`stats`:: -<>, <>, <> -- Specific 'tag' of the request for logging and statistical purposes -`version`:: -<> -- Specify whether to return document version as part of a hit -`versionType`:: -<> -- Should the document increment the version number (internal) on hit or not (reindex) -`requestCache`:: -<> -- Specify if request cache should be used for this request or not, defaults to index level setting -`refresh`:: -<> -- Should the effected indexes be refreshed? -`[timeout=1m]`:: -<> -- Time each individual bulk request should wait for shards that are unavailable. -`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) -`scrollSize`:: -<> -- Size on the scroll request powering the update_by_query -`[waitForCompletion=true]`:: -<> -- Should the request should block until the update by query operation is complete. -`requestsPerSecond`:: -<> -- The throttle to set on this request in sub-requests per second. -1 means no throttle. -`[slices=1]`:: -<> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -`index`:: -<>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cat-aliases-5-5]] -=== `cat.aliases` - -[source,js] --------- -client.cat.aliases([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-cat-allocation-5-5]] -=== `cat.allocation` - -[source,js] --------- -client.cat.allocation([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`nodeId`:: -<>, <>, <> -- A comma-separated list of node IDs or names to limit the returned information - -link:#[back to top] - -[[api-cat-count-5-5]] -=== `cat.count` - -[source,js] --------- -client.cat.count([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-count.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-fielddata-5-5]] -=== `cat.fielddata` - -[source,js] --------- -client.cat.fielddata([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`fields`:: -<>, <>, <> -- A comma-separated list of fields to return the fielddata size - -link:#[back to top] - -[[api-cat-health-5-5]] -=== `cat.health` - -[source,js] --------- -client.cat.health([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`[ts=true]`:: -<> -- Set to false to disable timestamping -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-help-5-5]] -=== `cat.help` - -[source,js] --------- -client.cat.help([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by - -link:#[back to top] - -[[api-cat-indices-5-5]] -=== `cat.indices` - -[source,js] --------- -client.cat.indices([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"m"` - * `"g"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`health`:: -<> -- A health status ("green", "yellow", or "red" to filter only indices matching the specified health status -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`help`:: -<> -- Return help information -`pri`:: -<> -- Set to true to return stats only for primary shards -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-master-5-5]] -=== `cat.master` - -[source,js] --------- -client.cat.master([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-master.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodeattrs-5-5]] -=== `cat.nodeattrs` - -[source,js] --------- -client.cat.nodeattrs([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-nodes-5-5]] -=== `cat.nodes` - -[source,js] --------- -client.cat.nodes([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`fullId`:: -<> -- Return the full node ID instead of the shortened version (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-pendingtasks-5-5]] -=== `cat.pendingTasks` - -[source,js] --------- -client.cat.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-plugins-5-5]] -=== `cat.plugins` - -[source,js] --------- -client.cat.plugins([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-recovery-5-5]] -=== `cat.recovery` - -[source,js] --------- -client.cat.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`bytes`:: -<> -- The unit in which to display byte values -Options::: - * `"b"` - * `"k"` - * `"kb"` - * `"m"` - * `"mb"` - * `"g"` - * `"gb"` - * `"t"` - * `"tb"` - * `"p"` - * `"pb"` - -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-repositories-5-5]] -=== `cat.repositories` - -[source,js] --------- -client.cat.repositories([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-segments-5-5]] -=== `cat.segments` - -[source,js] --------- -client.cat.segments([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-shards-5-5]] -=== `cat.shards` - -[source,js] --------- -client.cat.shards([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`index`:: -<>, <>, <> -- A comma-separated list of index names to limit the returned information - -link:#[back to top] - -[[api-cat-snapshots-5-5]] -=== `cat.snapshots` - -[source,js] --------- -client.cat.snapshots([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`ignoreUnavailable`:: -<> -- Set to true to ignore unavailable snapshots -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`repository`:: -<>, <>, <> -- Name of repository from which to fetch the snapshot information - -link:#[back to top] - -[[api-cat-tasks-5-5]] -=== `cat.tasks` - -[source,js] --------- -client.cat.tasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id. Set to -1 to return all. -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers - -link:#[back to top] - -[[api-cat-templates-5-5]] -=== `cat.templates` - -[source,js] --------- -client.cat.templates([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`name`:: -<> -- A pattern that returned template names must match - -link:#[back to top] - -[[api-cat-threadpool-5-5]] -=== `cat.threadPool` - -[source,js] --------- -client.cat.threadPool([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`format`:: -<> -- a short version of the Accept header, e.g. json, yaml -`size`:: -<> -- The multiplier in which to display values -Options::: - * `""` - * `"k"` - * `"m"` - * `"g"` - * `"t"` - * `"p"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`h`:: -<>, <>, <> -- Comma-separated list of column names to display -`help`:: -<> -- Return help information -`s`:: -<>, <>, <> -- Comma-separated list of column names or column aliases to sort by -`v`:: -<> -- Verbose mode. Display column headers -`threadPoolPatterns`:: -<>, <>, <> -- A comma-separated list of regular-expressions to filter the thread pools in the output - -link:#[back to top] - -[[api-cluster-allocationexplain-5-5]] -=== `cluster.allocationExplain` - -[source,js] --------- -client.cluster.allocationExplain([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeYesDecisions`:: -<> -- Return 'YES' decisions in explanation (default: false) -`includeDiskInfo`:: -<> -- Return information about disk usage and shard sizes (default: false) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-getsettings-5-5]] -=== `cluster.getSettings` - -[source,js] --------- -client.cluster.getSettings([params, [callback]]) --------- - -Get cluster settings (previously set with `putSettings()`) - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`includeDefaults`:: -<> -- Whether to return all default clusters setting. - -link:#[back to top] - -[[api-cluster-health-5-5]] -=== `cluster.health` - -[source,js] --------- -client.cluster.health([params, [callback]]) --------- - -Get a very simple status on the health of the cluster. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`[level=cluster]`:: -<> -- Specify the level of detail for returned information -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`waitForActiveShards`:: -<> -- Wait until the specified number of shards is active -`waitForNodes`:: -<> -- Wait until the specified number of nodes is available -`waitForEvents`:: -<> -- Wait until all currently queued events with the given priority are processed -Options::: - * `"immediate"` - * `"urgent"` - * `"high"` - * `"normal"` - * `"low"` - * `"languid"` - -`waitForNoRelocatingShards`:: -<> -- Whether to wait until there are no relocating shards in the cluster -`waitForStatus`:: -<> -- Wait until cluster is in a specific state -Options::: - * `"green"` - * `"yellow"` - * `"red"` - -`index`:: -<>, <>, <> -- Limit the information returned to a specific index - -link:#[back to top] - -[[api-cluster-pendingtasks-5-5]] -=== `cluster.pendingTasks` - -[source,js] --------- -client.cluster.pendingTasks([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master - -link:#[back to top] - -[[api-cluster-putsettings-5-5]] -=== `cluster.putSettings` - -[source,js] --------- -client.cluster.putSettings([params, [callback]]) --------- - -Update cluster wide specific settings. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-reroute-5-5]] -=== `cluster.reroute` - -[source,js] --------- -client.cluster.reroute([params, [callback]]) --------- - -Explicitly execute a cluster reroute allocation command including specific commands. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`dryRun`:: -<> -- Simulate the operation only and return the resulting state -`explain`:: -<> -- Return an explanation of why the commands can or cannot be executed -`retryFailed`:: -<> -- Retries allocation of shards that are blocked due to too many subsequent allocation failures -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics. Defaults to all but metadata -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-cluster-state-5-5]] -=== `cluster.state` - -[source,js] --------- -client.cluster.state([params, [callback]]) --------- - -Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics - -link:#[back to top] - -[[api-cluster-stats-5-5]] -=== `cluster.stats` - -[source,js] --------- -client.cluster.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-indices-analyze-5-5]] -=== `indices.analyze` - -[source,js] --------- -client.indices.analyze([params, [callback]]) --------- - -Perform the analysis process on a text and return the tokens breakdown of the text. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`analyzer`:: -<> -- The name of the analyzer to use -`charFilter`:: -<>, <>, <> -- A comma-separated list of character filters to use for the analysis -`field`:: -<> -- Use the analyzer configured for this field (instead of passing the analyzer name) -`filter`:: -<>, <>, <> -- A comma-separated list of filters to use for the analysis -`index`:: -<> -- The name of the index to scope the operation -`preferLocal`:: -<> -- With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) -`text`:: -<>, <>, <> -- The text on which the analysis should be performed (when request body is not used) -`tokenizer`:: -<> -- The name of the tokenizer to use for the analysis -`explain`:: -<> -- With `true`, outputs more advanced details. (default: false) -`attributes`:: -<>, <>, <> -- A comma-separated list of token attributes to output, this parameter works only with `explain=true` -`[format=detailed]`:: -<> -- Format of the output -Options::: - * `"detailed"` - * `"text"` - -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-clearcache-5-5]] -=== `indices.clearCache` - -[source,js] --------- -client.indices.clearCache([params, [callback]]) --------- - -Clear either all caches or specific cached associated with one ore more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`fieldData`:: -<> -- Clear field data -`fielddata`:: -<> -- Clear field data -`fields`:: -<>, <>, <> -- A comma-separated list of fields to clear when using the `field_data` parameter (default: all) -`query`:: -<> -- Clear query caches -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index name to limit the operation -`recycler`:: -<> -- Clear the recycler cache -`requestCache`:: -<> -- Clear request cache -`request`:: -<> -- Clear request cache -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-close-5-5]] -=== `indices.close` - -[source,js] --------- -client.indices.close([params, [callback]]) --------- - -Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations. - - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to close -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-create-5-5]] -=== `indices.create` - -[source,js] --------- -client.indices.create([params, [callback]]) --------- - -Create an index in Elasticsearch. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for before the operation returns. -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`index`:: -<> -- The name of the index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-delete-5-5]] -=== `indices.delete` - -[source,js] --------- -client.indices.delete([params, [callback]]) --------- - -Delete an index in Elasticsearch - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletealias-5-5]] -=== `indices.deleteAlias` - -[source,js] --------- -client.indices.deleteAlias([params, [callback]]) --------- - -Delete a specific alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names (supports wildcards); use `_all` for all indices -`name`:: -<>, <>, <> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-deletetemplate-5-5]] -=== `indices.deleteTemplate` - -[source,js] --------- -client.indices.deleteTemplate([params, [callback]]) --------- - -Delete an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-exists-5-5]] -=== `indices.exists` - -[source,js] --------- -client.indices.exists([params, [callback]]) --------- - -Return a boolean indicating whether given index exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Ignore unavailable indexes (default: false) -`allowNoIndices`:: -<> -- Ignore if a wildcard expression resolves to no concrete indices (default: false) -`[expandWildcards=open]`:: -<> -- Whether wildcard expressions should get expanded to open or closed indices (default: open) -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existsalias-5-5]] -=== `indices.existsAlias` - -[source,js] --------- -client.indices.existsAlias([params, [callback]]) --------- - -Return a boolean indicating whether given alias exists. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=all]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstemplate-5-5]] -=== `indices.existsTemplate` - -[source,js] --------- -client.indices.existsTemplate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<>, <>, <> -- The comma separated names of the index templates -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-existstype-5-5]] -=== `indices.existsType` - -[source,js] --------- -client.indices.existsType([params, [callback]]) --------- - -Check if a type/types exists in an index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` to check the types across all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to check -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flush-5-5]] -=== `indices.flush` - -[source,js] --------- -client.indices.flush([params, [callback]]) --------- - -Explicitly flush one or more indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`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. -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-flushsynced-5-5]] -=== `indices.flushSynced` - -[source,js] --------- -client.indices.flushSynced([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-forcemerge-5-5]] -=== `indices.forcemerge` - -[source,js] --------- -client.indices.forcemerge([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flush`:: -<> -- Specify whether the index should be flushed after performing the operation (default: true) -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`maxNumSegments`:: -<> -- The number of segments the index should be merged into (default: dynamic) -`onlyExpungeDeletes`:: -<> -- Specify whether the operation should only expunge deleted documents -`operationThreading`:: -anything -- TODO: ? -`waitForMerge`:: -<> -- Specify whether the request should block until the merge process is finished (default: true) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-get-5-5]] -=== `indices.get` - -[source,js] --------- -client.indices.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`ignoreUnavailable`:: -<> -- Ignore unavailable indexes (default: false) -`allowNoIndices`:: -<> -- Ignore if a wildcard expression resolves to no concrete indices (default: false) -`[expandWildcards=open]`:: -<> -- Whether wildcard expressions should get expanded to open or closed indices (default: open) -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names -`feature`:: -<>, <>, <> -- A comma-separated list of features - -link:#[back to top] - -[[api-indices-getalias-5-5]] -=== `indices.getAlias` - -[source,js] --------- -client.indices.getAlias([params, [callback]]) --------- - -Retrieve a specified alias. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=all]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names to filter aliases -`name`:: -<>, <>, <> -- A comma-separated list of alias names to return - -link:#[back to top] - -[[api-indices-getfieldmapping-5-5]] -=== `indices.getFieldMapping` - -[source,js] --------- -client.indices.getFieldMapping([params, [callback]]) --------- - -Retrieve mapping definition of a specific field. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`includeDefaults`:: -<> -- Whether the default mapping values should be returned as well -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types -`fields`:: -<>, <>, <> -- A comma-separated list of fields - -link:#[back to top] - -[[api-indices-getmapping-5-5]] -=== `indices.getMapping` - -[source,js] --------- -client.indices.getMapping([params, [callback]]) --------- - -Retrieve mapping definition of index or index/type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names -`type`:: -<>, <>, <> -- A comma-separated list of document types - -link:#[back to top] - -[[api-indices-getsettings-5-5]] -=== `indices.getSettings` - -[source,js] --------- -client.indices.getSettings([params, [callback]]) --------- - -Retrieve settings for one or more (or all) indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open,closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`includeDefaults`:: -<> -- Whether to return all default setting for each of the indices. -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`name`:: -<>, <>, <> -- The name of the settings that should be included - -link:#[back to top] - -[[api-indices-gettemplate-5-5]] -=== `indices.getTemplate` - -[source,js] --------- -client.indices.getTemplate([params, [callback]]) --------- - -Retrieve an index template by its name. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`name`:: -<>, <>, <> -- The comma separated names of the index templates - -link:#[back to top] - -[[api-indices-getupgrade-5-5]] -=== `indices.getUpgrade` - -[source,js] --------- -client.indices.getUpgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-open-5-5]] -=== `indices.open` - -[source,js] --------- -client.indices.open([params, [callback]]) --------- - -Open a closed index, making it available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=closed]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma separated list of indices to open -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putalias-5-5]] -=== `indices.putAlias` - -[source,js] --------- -client.indices.putAlias([params, [callback]]) --------- - -Create an alias for a specific index/indices. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit timestamp for the document -`masterTimeout`:: -<> -- Specify timeout for connection to master -`index`:: -<>, <>, <> -- A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -`name`:: -<> -- The name of the alias to be created or updated -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putmapping-5-5]] -=== `indices.putMapping` - -[source,js] --------- -client.indices.putMapping([params, [callback]]) --------- - -Register specific mapping definition for a specific type. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`updateAllTypes`:: -<> -- Whether to update the mapping for all fields with the same name across all types or not -`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. -`type`:: -<> -- The name of the document type -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-putsettings-5-5]] -=== `indices.putSettings` - -[source,js] --------- -client.indices.putSettings([params, [callback]]) --------- - -Change specific index level settings in real time. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Specify timeout for connection to master -`preserveExisting`:: -<> -- Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-puttemplate-5-5]] -=== `indices.putTemplate` - -[source,js] --------- -client.indices.putTemplate([params, [callback]]) --------- - -Create an index template that will automatically be applied to new indices created. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`order`:: -<> -- The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) -`create`:: -<> -- Whether the index template should only be added if new or can also replace an existing one -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`name`:: -<> -- The name of the template -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-recovery-5-5]] -=== `indices.recovery` - -[source,js] --------- -client.indices.recovery([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`detailed`:: -<> -- Whether to display detailed information about shard recovery -`activeOnly`:: -<> -- Display only those recoveries that are currently on-going -`index`:: -<>, <>, <> -- 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-5-5]] -=== `indices.refresh` - -[source,js] --------- -client.indices.refresh([params, [callback]]) --------- - -Explicitly refresh one or more index, making all operations performed since the last refresh available for search. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-rollover-5-5]] -=== `indices.rollover` - -[source,js] --------- -client.indices.rollover([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`dryRun`:: -<> -- If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the newly created rollover index before the operation returns. -`alias`:: -<> -- The name of the alias to rollover -`newIndex`:: -<> -- The name of the rollover index -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-segments-5-5]] -=== `indices.segments` - -[source,js] --------- -client.indices.segments([params, [callback]]) --------- - -Retrieve low level segments information that a Lucene index (shard level) is built with. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`verbose`:: -<> -- Includes detailed memory usage by Lucene. -`index`:: -<>, <>, <> -- 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-5-5]] -=== `indices.shardStores` - -[source,js] --------- -client.indices.shardStores([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`status`:: -<>, <>, <> -- A comma-separated list of statuses used to filter on shards to get store information for -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - -link:#[back to top] - -[[api-indices-shrink-5-5]] -=== `indices.shrink` - -[source,js] --------- -client.indices.shrink([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`timeout`:: -<> -- Explicit operation timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`waitForActiveShards`:: -<> -- Set the number of active shards to wait for on the shrunken index before the operation returns. -`index`:: -<> -- The name of the source index to shrink -`target`:: -<> -- The name of the target index to shrink into -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-stats-5-5]] -=== `indices.stats` - -[source,js] --------- -client.indices.stats([params, [callback]]) --------- - -Retrieve statistics on different operations happening on an index. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<>, <>, <> -- A comma-separated list of search groups for `search` index metric -`[level=indices]`:: -<> -- Return stats aggregated at cluster, index or shard level -Options::: - * `"cluster"` - * `"indices"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`metric`:: -<>, <>, <> -- Limit the information returned the specific metrics. - -link:#[back to top] - -[[api-indices-updatealiases-5-5]] -=== `indices.updateAliases` - -[source,js] --------- -client.indices.updateAliases([params, [callback]]) --------- - -Update specified aliases. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. - -.Perform an atomic alias swap, for a rotating index -[source,js] ---------- -const response = await client.indices.updateAliases({ - body: { - actions: [ - { remove: { index: 'logstash-2014.04', alias: 'logstash-current' } }, - { add: { index: 'logstash-2014.05', alias: 'logstash-current' } } - ] - } -}); ---------- - - - -*Params* - -[horizontal] -`timeout`:: -<> -- Request timeout -`masterTimeout`:: -<> -- Specify timeout for connection to master -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-upgrade-5-5]] -=== `indices.upgrade` - -[source,js] --------- -client.indices.upgrade([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`waitForCompletion`:: -<> -- Specify whether the request should block until the all segments are upgraded (default: false) -`onlyAncientSegments`:: -<> -- If true, only ancient (an older Lucene major release) segments will be upgraded -`index`:: -<>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-indices-validatequery-5-5]] -=== `indices.validateQuery` - -[source,js] --------- -client.indices.validateQuery([params, [callback]]) --------- - -Validate a potentially expensive query without executing it. - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-validate.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`explain`:: -<> -- Return detailed information about the error -`ignoreUnavailable`:: -<> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`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) -`[expandWildcards=open]`:: -<> -- Whether to expand wildcard expression to concrete indices that are open, closed or both. -Options::: - * `"open"` - * `"closed"` - * `"none"` - * `"all"` - -`operationThreading`:: -anything -- TODO: ? -`q`:: -<> -- Query in the Lucene query string syntax -`analyzer`:: -<> -- The analyzer to use for the query string -`analyzeWildcard`:: -<> -- Specify whether wildcard and prefix queries should be analyzed (default: false) -`[defaultOperator=OR]`:: -<> -- The default operator for query string query (AND or OR) -Options::: - * `"AND"` - * `"OR"` - -`df`:: -<> -- The field to use as default where no field prefix is given in the query string -`lenient`:: -<> -- Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -`rewrite`:: -<> -- Provide a more detailed explanation showing the actual Lucene query that will be executed. -`allShards`:: -<> -- Execute validation on all shards instead of one random shard per index -`index`:: -<>, <>, <> -- A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -`type`:: -<>, <>, <> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-validate.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-deletepipeline-5-5]] -=== `ingest.deletePipeline` - -[source,js] --------- -client.ingest.deletePipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-getpipeline-5-5]] -=== `ingest.getPipeline` - -[source,js] --------- -client.ingest.getPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`id`:: -<> -- Comma separated list of pipeline ids. Wildcards supported - -link:#[back to top] - -[[api-ingest-putpipeline-5-5]] -=== `ingest.putPipeline` - -[source,js] --------- -client.ingest.putPipeline([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-ingest-simulate-5-5]] -=== `ingest.simulate` - -[source,js] --------- -client.ingest.simulate([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`verbose`:: -<> -- Verbose mode. Display data output for each processor in executed pipeline -`id`:: -<> -- Pipeline ID -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-nodes-hotthreads-5-5]] -=== `nodes.hotThreads` - -[source,js] --------- -client.nodes.hotThreads([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`interval`:: -<> -- The interval for the second sampling of threads -`snapshots`:: -<> -- Number of samples of thread stacktrace (default: 10) -`threads`:: -<> -- Specify the number of threads to provide information for (default: 3) -`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) -`type`:: -<> -- The type to sample (default: cpu) -Options::: - * `"cpu"` - * `"wait"` - * `"block"` - -`timeout`:: -<> -- Explicit operation timeout -`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 - -link:#[back to top] - -[[api-nodes-info-5-5]] -=== `nodes.info` - -[source,js] --------- -client.nodes.info([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`flatSettings`:: -<> -- Return settings in flat format (default: false) -`timeout`:: -<> -- Explicit operation timeout -`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 -`metric`:: -<>, <>, <> -- A comma-separated list of metrics you wish returned. Leave empty to return all. - -link:#[back to top] - -[[api-nodes-stats-5-5]] -=== `nodes.stats` - -[source,js] --------- -client.nodes.stats([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`completionFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) -`fielddataFields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` index metric (supports wildcards) -`fields`:: -<>, <>, <> -- A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) -`groups`:: -<> -- A comma-separated list of search groups for `search` index metric -`[level=node]`:: -<> -- Return indices stats aggregated at index, node or shard level -Options::: - * `"indices"` - * `"node"` - * `"shards"` - -`types`:: -<>, <>, <> -- A comma-separated list of document types for the `indexing` index metric -`timeout`:: -<> -- Explicit operation timeout -`includeSegmentFileSizes`:: -<> -- Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) -`metric`:: -<>, <>, <> -- Limit the information returned to the specified metrics -`indexMetric`:: -<>, <>, <> -- Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. -`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 - -link:#[back to top] - -[[api-remote-info-5-5]] -=== `remote.info` - -[source,js] --------- -client.remote.info([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-remote-info.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - - -[[api-snapshot-create-5-5]] -=== `snapshot.create` - -[source,js] --------- -client.snapshot.create([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-createrepository-5-5]] -=== `snapshot.createRepository` - -[source,js] --------- -client.snapshot.createRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`verify`:: -<> -- Whether to verify the repository after creation -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-delete-5-5]] -=== `snapshot.delete` - -[source,js] --------- -client.snapshot.delete([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-deleterepository-5-5]] -=== `snapshot.deleteRepository` - -[source,js] --------- -client.snapshot.deleteRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<>, <>, <> -- A comma-separated list of repository names -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-get-5-5]] -=== `snapshot.get` - -[source,js] --------- -client.snapshot.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`verbose`:: -<> -- Whether to show verbose snapshot info or only show the basic info found in the repository index blob -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-getrepository-5-5]] -=== `snapshot.getRepository` - -[source,js] --------- -client.snapshot.getRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`local`:: -<> -- Return local information, do not retrieve the state from master node (default: false) -`repository`:: -<>, <>, <> -- A comma-separated list of repository names - -link:#[back to top] - -[[api-snapshot-restore-5-5]] -=== `snapshot.restore` - -[source,js] --------- -client.snapshot.restore([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`waitForCompletion`:: -<> -- Should this request wait until the operation has completed before returning -`repository`:: -<> -- A repository name -`snapshot`:: -<> -- A snapshot name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-snapshot-status-5-5]] -=== `snapshot.status` - -[source,js] --------- -client.snapshot.status([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`ignoreUnavailable`:: -<> -- Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown -`repository`:: -<> -- A repository name -`snapshot`:: -<>, <>, <> -- A comma-separated list of snapshot names - -link:#[back to top] - -[[api-snapshot-verifyrepository-5-5]] -=== `snapshot.verifyRepository` - -[source,js] --------- -client.snapshot.verifyRepository([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`masterTimeout`:: -<> -- Explicit operation timeout for connection to master node -`timeout`:: -<> -- Explicit operation timeout -`repository`:: -<> -- A repository name -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-cancel-5-5]] -=== `tasks.cancel` - -[source,js] --------- -client.tasks.cancel([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be cancelled. Leave empty to cancel all. -`parentNode`:: -<> -- Cancel tasks with specified parent node. -`parentTask`:: -<> -- Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. -`taskId`:: -<> -- Cancel the task with specified task id (node_id:task_number) -`body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html[the elasticsearch docs] for details about what can be specified here. - -link:#[back to top] - -[[api-tasks-get-5-5]] -=== `tasks.get` - -[source,js] --------- -client.tasks.get([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`taskId`:: -<> -- Return the task with specified id (node_id:task_number) - -link:#[back to top] - -[[api-tasks-list-5-5]] -=== `tasks.list` - -[source,js] --------- -client.tasks.list([params, [callback]]) --------- - -// no description - -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. - -// no examples - - -*Params* - -[horizontal] -`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 -`actions`:: -<>, <>, <> -- A comma-separated list of actions that should be returned. Leave empty to return all. -`detailed`:: -<> -- Return detailed task information (default: false) -`parentNode`:: -<> -- Return tasks with specified parent node. -`parentTask`:: -<> -- Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. -`waitForCompletion`:: -<> -- Wait for the matching tasks to complete (default: false) -`[groupBy=nodes]`:: -<> -- Group tasks by nodes or parent/child relationships -Options::: - * `"nodes"` - * `"parents"` - - -link:#[back to top] diff --git a/docs/api_methods_6_6.asciidoc b/docs/api_methods_6_5.asciidoc similarity index 91% rename from docs/api_methods_6_6.asciidoc rename to docs/api_methods_6_5.asciidoc index 14220924a..86cf62742 100644 --- a/docs/api_methods_6_6.asciidoc +++ b/docs/api_methods_6_5.asciidoc @@ -1,11 +1,11 @@ -[[api-reference-6-6]] -== 6.6 API +[[api-reference-6-5]] +== 6.5 API -NOTE: At this time, you must opt into the 6.6 API by setting the `apiVersion` config parameter. +NOTE: At this time, you must opt into the 6.5 API by setting the `apiVersion` config parameter. -[[api-bulk-6-6]] +[[api-bulk-6-5]] === `bulk` [source,js] @@ -15,7 +15,7 @@ client.bulk([params, [callback]]) Perform many index/delete operations in a single API call. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-bulk.html[the elasticsearch docs] for more information pertaining to this method. .Perform three operations in a single request [source,js] @@ -63,20 +63,20 @@ Options::: <>, <>, <> -- Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request `_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 -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- Default list of fields to extract and return from the _source field, can be overridden on each sub-request `pipeline`:: <> -- The pipeline id to preprocess incoming documents with `index`:: <> -- Default index for items which don't provide one `body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-bulk.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-clearscroll-6-6]] +[[api-clearscroll-6-5]] === `clearScroll` [source,js] @@ -86,7 +86,7 @@ client.clearScroll([params, [callback]]) Clear the scroll request created by specifying the scroll parameter to search. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -97,11 +97,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `scrollId`:: <>, <>, <> -- A comma-separated list of scroll IDs to clear `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-count-6-6]] +[[api-count-6-5]] === `count` [source,js] @@ -111,7 +111,7 @@ client.count([params, [callback]]) Get the number of documents for the cluster, index, type, or a query. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-count.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-count.html[the elasticsearch docs] for more information pertaining to this method. .Get the number of all documents in the cluster [source,js] @@ -153,8 +153,6 @@ const { count } = await client.count({ [horizontal] `ignoreUnavailable`:: <> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`ignoreThrottled`:: -<> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled `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) `[expandWildcards=open]`:: @@ -194,11 +192,11 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of types to restrict the results `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-count.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-count.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-create-6-6]] +[[api-create-6-5]] === `create` [source,js] @@ -208,7 +206,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. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. .Create a document [source,js] @@ -267,11 +265,11 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-index_.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-index_.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-delete-6-6]] +[[api-delete-6-5]] === `delete` [source,js] @@ -281,7 +279,7 @@ client.delete([params, [callback]]) Delete a typed JSON document from a specific index based on its id. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete.html[the elasticsearch docs] for more information pertaining to this method. .Delete the document `/myindex/mytype/1` [source,js] @@ -314,10 +312,6 @@ Options::: <> -- Specific routing value `timeout`:: <> -- Explicit operation timeout -`ifSeqNo`:: -<> -- only perform the delete operation if the last operation that has changed the document has the specified sequence number -`ifPrimaryTerm`:: -<> -- only perform the delete operation if the last operation that has changed the document has the specified primary term `version`:: <> -- Explicit version number for concurrency control `versionType`:: @@ -335,11 +329,11 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-deletebyquery-6-6]] +[[api-deletebyquery-6-5]] === `deleteByQuery` [source,js] @@ -349,7 +343,7 @@ client.deleteByQuery([params, [callback]]) Delete documents from one or more indices and one or more types based on a query. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. .Deleting documents with a simple query [source,js] @@ -434,9 +428,9 @@ Options::: <>, <>, <> -- A comma-separated list of : pairs `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `terminateAfter`:: <> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. @@ -465,11 +459,11 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-deletebyqueryrethrottle-6-6]] +[[api-deletebyqueryrethrottle-6-5]] === `deleteByQueryRethrottle` [source,js] @@ -479,7 +473,7 @@ client.deleteByQueryRethrottle([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete-by-query.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -492,11 +486,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `taskId`:: <> -- The task id to rethrottle `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-delete-by-query.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-deletescript-6-6]] +[[api-deletescript-6-5]] === `deleteScript` [source,js] @@ -506,7 +500,7 @@ client.deleteScript([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -521,11 +515,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Script ID `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-exists-6-6]] +[[api-exists-6-5]] === `exists` [source,js] @@ -535,7 +529,7 @@ client.exists([params, [callback]]) Returns a boolean indicating whether or not a given document exists. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. .Check that the document `/myindex/mytype/1` exist [source,js] @@ -566,9 +560,9 @@ const exists = await client.exists({ <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `version`:: <> -- Explicit version number for concurrency control @@ -587,11 +581,11 @@ Options::: `type`:: <> -- The type of the document (use `_all` to fetch the first document matching the ID across all types) `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-existssource-6-6]] +[[api-existssource-6-5]] === `existsSource` [source,js] @@ -601,7 +595,7 @@ client.existsSource([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -621,9 +615,9 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `version`:: <> -- Explicit version number for concurrency control @@ -642,11 +636,11 @@ Options::: `type`:: <> -- The type of the document; use `_all` to fetch the first document matching the ID across all types `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-explain-6-6]] +[[api-explain-6-5]] === `explain` [source,js] @@ -657,7 +651,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. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-explain.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-explain.html[the elasticsearch docs] for more information pertaining to this method. .See how a document is scored against a simple query [source,js] @@ -719,9 +713,9 @@ Options::: <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `id`:: <> -- The document ID @@ -730,11 +724,11 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-explain.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-explain.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-fieldcaps-6-6]] +[[api-fieldcaps-6-5]] === `fieldCaps` [source,js] @@ -744,7 +738,7 @@ client.fieldCaps([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-field-caps.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-field-caps.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -769,11 +763,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-field-caps.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-field-caps.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-get-6-6]] +[[api-get-6-5]] === `get` [source,js] @@ -783,7 +777,7 @@ client.get([params, [callback]]) Get a typed JSON document from the index based on its id. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. .Get `/myindex/mytype/1` [source,js] @@ -814,10 +808,6 @@ const response = await client.get({ <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: -<>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: -<>, <>, <> -- A list of fields to extract and return from the _source field `_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field `_sourceInclude`:: @@ -841,7 +831,7 @@ Options::: link:#[back to top] -[[api-getscript-6-6]] +[[api-getscript-6-5]] === `getScript` [source,js] @@ -851,7 +841,7 @@ client.getScript([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -866,7 +856,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-getsource-6-6]] +[[api-getsource-6-5]] === `getSource` [source,js] @@ -877,7 +867,7 @@ client.getSource([params, [callback]]) Get the source of a document by its index, type and id. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-get.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -897,9 +887,9 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `version`:: <> -- Explicit version number for concurrency control @@ -920,7 +910,7 @@ Options::: link:#[back to top] -[[api-index-6-6]] +[[api-index-6-5]] === `index` [source,js] @@ -935,7 +925,7 @@ Optimistic concurrency control is performed, when the `version` argument is spec 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 <>. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-index_.html[the elasticsearch docs] for more information pertaining to this method. .Create or update a document [source,js] @@ -989,10 +979,6 @@ Options::: * `"external_gte"` * `"force"` -`ifSeqNo`:: -<> -- only perform the index operation if the last operation that has changed the document has the specified sequence number -`ifPrimaryTerm`:: -<> -- only perform the index operation if the last operation that has changed the document has the specified primary term `pipeline`:: <> -- The pipeline id to preprocess incoming documents with `id`:: @@ -1002,11 +988,11 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-index_.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-index_.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-info-6-6]] +[[api-info-6-5]] === `info` [source,js] @@ -1022,7 +1008,7 @@ Check the *<>* and http://www.elastic.co/guide/[the elasticsear -[[api-mget-6-6]] +[[api-mget-6-5]] === `mget` [source,js] @@ -1032,7 +1018,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. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-multi-get.html[the elasticsearch docs] for more information pertaining to this method. .An array of doc locations. Useful for getting documents from different indices. [source,js] @@ -1077,20 +1063,20 @@ const response = await client.mget({ <> -- Specific routing value `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `index`:: <> -- The name of the index `type`:: <> -- The type of the document `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-multi-get.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-msearch-6-6]] +[[api-msearch-6-5]] === `msearch` [source,js] @@ -1100,7 +1086,7 @@ client.msearch([params, [callback]]) Execute several search requests within the same request. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. .Perform multiple different searches, the body is made up of meta/data pairs [source,js] @@ -1139,18 +1125,16 @@ Options::: <> -- A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. `[maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.]`:: <> -- The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests -`restTotalHitsAsInt`:: -<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `index`:: <>, <>, <> -- A comma-separated list of index names to use as default `type`:: <>, <>, <> -- A comma-separated list of document types to use as default `body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-msearchtemplate-6-6]] +[[api-msearchtemplate-6-5]] === `msearchTemplate` [source,js] @@ -1160,7 +1144,7 @@ client.msearchTemplate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-multi-search.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1180,18 +1164,16 @@ Options::: <> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response `maxConcurrentSearches`:: <> -- Controls the maximum number of concurrent searches the multi search api will execute -`restTotalHitsAsInt`:: -<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `index`:: <>, <>, <> -- A comma-separated list of index names to use as default `type`:: <>, <>, <> -- A comma-separated list of document types to use as default `body`:: -<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either an array of objects or new-line delimited JSON objects. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-multi-search.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-mtermvectors-6-6]] +[[api-mtermvectors-6-5]] === `mtermvectors` [source,js] @@ -1201,7 +1183,7 @@ client.mtermvectors([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-multi-termvectors.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1246,11 +1228,11 @@ Options::: `type`:: <> -- The type of the document. `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-multi-termvectors.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-ping-6-6]] +[[api-ping-6-5]] === `ping` [source,js] @@ -1266,7 +1248,7 @@ Check the *<>* and http://www.elastic.co/guide/[the elasticsear -[[api-putscript-6-6]] +[[api-putscript-6-5]] === `putScript` [source,js] @@ -1276,7 +1258,7 @@ client.putScript([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1293,11 +1275,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Script ID `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-scripting.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-rankeval-6-6]] +[[api-rankeval-6-5]] === `rankEval` [source,js] @@ -1307,7 +1289,7 @@ client.rankEval([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-rank-eval.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-rank-eval.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1330,11 +1312,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-rank-eval.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-rank-eval.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-reindex-6-6]] +[[api-reindex-6-5]] === `reindex` [source,js] @@ -1344,7 +1326,7 @@ client.reindex([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1365,11 +1347,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `[slices=1]`:: <> -- The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-reindexrethrottle-6-6]] +[[api-reindexrethrottle-6-5]] === `reindexRethrottle` [source,js] @@ -1379,7 +1361,7 @@ client.reindexRethrottle([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-reindex.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1392,11 +1374,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `taskId`:: <> -- The task id to rethrottle `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-reindex.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-rendersearchtemplate-6-6]] +[[api-rendersearchtemplate-6-5]] === `renderSearchTemplate` [source,js] @@ -1406,7 +1388,7 @@ client.renderSearchTemplate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1417,11 +1399,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- The id of the stored search template `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-scriptspainlessexecute-6-6]] +[[api-scriptspainlessexecute-6-5]] === `scriptsPainlessExecute` [source,js] @@ -1431,13 +1413,13 @@ client.scriptsPainlessExecute([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/painless/6.6/painless-execute-api.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/painless/6.5/painless-execute-api.html[the elasticsearch docs] for more information pertaining to this method. // no examples -[[api-scroll-6-6]] +[[api-scroll-6-5]] === `scroll` [source,js] @@ -1447,7 +1429,7 @@ client.scroll([params, [callback]]) Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-request-scroll.html[the elasticsearch docs] for more information pertaining to this method. .Collect every title in the index that contains the word "test" [source,js] @@ -1497,14 +1479,12 @@ while (responseQueue.length) { <> -- Specify how long a consistent view of the index should be maintained for scrolled search `scrollId`:: <> -- The scroll ID -`restTotalHitsAsInt`:: -<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-request-scroll.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-search-6-6]] +[[api-search-6-5]] === `search` [source,js] @@ -1518,7 +1498,7 @@ TIP: https://github.com/danpaz/bodybuilder[bodybuilder] and https://github.com/s -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-search.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-search.html[the elasticsearch docs] for more information pertaining to this method. .Search with a simple query string query [source,js] @@ -1578,8 +1558,6 @@ Options::: <> -- Starting offset (default: 0) `ignoreUnavailable`:: <> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`ignoreThrottled`:: -<> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled `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) `[expandWildcards=open]`:: @@ -1612,9 +1590,9 @@ Options::: <>, <>, <> -- A comma-separated list of : pairs `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `terminateAfter`:: <> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. @@ -1653,18 +1631,16 @@ Options::: <> -- The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests `[preFilterShardSize=128]`:: <> -- A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. -`restTotalHitsAsInt`:: -<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `index`:: <>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `type`:: <>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-search.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-search.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-searchshards-6-6]] +[[api-searchshards-6-5]] === `searchShards` [source,js] @@ -1674,7 +1650,7 @@ client.searchShards([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-shards.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-shards.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1703,11 +1679,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-shards.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-shards.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-searchtemplate-6-6]] +[[api-searchtemplate-6-5]] === `searchTemplate` [source,js] @@ -1717,7 +1693,7 @@ client.searchTemplate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1727,8 +1703,6 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc [horizontal] `ignoreUnavailable`:: <> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) -`ignoreThrottled`:: -<> -- Whether specified concrete, expanded or aliased indices should be ignored when throttled `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) `[expandWildcards=open]`:: @@ -1759,18 +1733,16 @@ Options::: <> -- Specify whether to profile the query execution `typedKeys`:: <> -- Specify whether aggregation and suggester names should be prefixed by their respective types in the response -`restTotalHitsAsInt`:: -<> -- This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number `index`:: <>, <>, <> -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `type`:: <>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-termvectors-6-6]] +[[api-termvectors-6-5]] === `termvectors` [source,js] @@ -1780,7 +1752,7 @@ client.termvectors([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-termvectors.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -1825,11 +1797,11 @@ Options::: `id`:: <> -- The id of the document, when not specified a doc param should be supplied. `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-termvectors.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-update-6-6]] +[[api-update-6-5]] === `update` [source,js] @@ -1842,7 +1814,7 @@ Update parts of a document. The required body parameter can contain one of two t * a partial document, which will be merged with the existing one. * a `script` which will update the document content -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update.html[the elasticsearch docs] for more information pertaining to this method. .Update document title using partial document [source,js] @@ -1917,9 +1889,9 @@ const response = await client.update({ <>, <>, <> -- A comma-separated list of fields to return in the response `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `lang`:: <> -- The script language (default: painless) @@ -1954,11 +1926,11 @@ Options::: `type`:: <> -- The type of the document `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-updatebyquery-6-6]] +[[api-updatebyquery-6-5]] === `updateByQuery` [source,js] @@ -1968,7 +1940,7 @@ client.updateByQuery([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2034,9 +2006,9 @@ Options::: <>, <>, <> -- A comma-separated list of : pairs `_source`:: <>, <>, <> -- True or false to return the _source field or not, or a list of fields to return -`_sourceExcludes`:: +`_sourceExclude`:: <>, <>, <> -- A list of fields to exclude from the returned _source field -`_sourceIncludes`:: +`_sourceInclude`:: <>, <>, <> -- A list of fields to extract and return from the _source field `terminateAfter`:: <> -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. @@ -2067,11 +2039,11 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of document types to search; leave empty to perform the operation on all types `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-updatebyqueryrethrottle-6-6]] +[[api-updatebyqueryrethrottle-6-5]] === `updateByQueryRethrottle` [source,js] @@ -2081,7 +2053,7 @@ client.updateByQueryRethrottle([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update-by-query.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2094,11 +2066,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `taskId`:: <> -- The task id to rethrottle `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docs-update-by-query.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-cat-aliases-6-6]] +[[api-cat-aliases-6-5]] === `cat.aliases` [source,js] @@ -2108,7 +2080,7 @@ client.cat.aliases([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2135,7 +2107,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-allocation-6-6]] +[[api-cat-allocation-6-5]] === `cat.allocation` [source,js] @@ -2145,7 +2117,7 @@ client.cat.allocation([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-allocation.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2187,7 +2159,7 @@ Options::: link:#[back to top] -[[api-cat-count-6-6]] +[[api-cat-count-6-5]] === `cat.count` [source,js] @@ -2197,7 +2169,7 @@ client.cat.count([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-count.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-count.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2224,7 +2196,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-fielddata-6-6]] +[[api-cat-fielddata-6-5]] === `cat.fielddata` [source,js] @@ -2234,7 +2206,7 @@ client.cat.fielddata([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-fielddata.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2276,7 +2248,7 @@ Options::: link:#[back to top] -[[api-cat-health-6-6]] +[[api-cat-health-6-5]] === `cat.health` [source,js] @@ -2286,7 +2258,7 @@ client.cat.health([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-health.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-health.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2313,7 +2285,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-help-6-6]] +[[api-cat-help-6-5]] === `cat.help` [source,js] @@ -2323,7 +2295,7 @@ client.cat.help([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2338,7 +2310,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-indices-6-6]] +[[api-cat-indices-6-5]] === `cat.indices` [source,js] @@ -2348,7 +2320,7 @@ client.cat.indices([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-indices.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2392,7 +2364,7 @@ Options::: link:#[back to top] -[[api-cat-master-6-6]] +[[api-cat-master-6-5]] === `cat.master` [source,js] @@ -2402,7 +2374,7 @@ client.cat.master([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-master.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-master.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2427,7 +2399,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-nodeattrs-6-6]] +[[api-cat-nodeattrs-6-5]] === `cat.nodeattrs` [source,js] @@ -2437,7 +2409,7 @@ client.cat.nodeattrs([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-nodeattrs.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2462,7 +2434,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-nodes-6-6]] +[[api-cat-nodes-6-5]] === `cat.nodes` [source,js] @@ -2472,7 +2444,7 @@ client.cat.nodes([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-nodes.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2499,7 +2471,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-pendingtasks-6-6]] +[[api-cat-pendingtasks-6-5]] === `cat.pendingTasks` [source,js] @@ -2509,7 +2481,7 @@ client.cat.pendingTasks([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-pending-tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2534,7 +2506,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-plugins-6-6]] +[[api-cat-plugins-6-5]] === `cat.plugins` [source,js] @@ -2544,7 +2516,7 @@ client.cat.plugins([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-plugins.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2569,7 +2541,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-recovery-6-6]] +[[api-cat-recovery-6-5]] === `cat.recovery` [source,js] @@ -2579,7 +2551,7 @@ client.cat.recovery([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-recovery.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2619,7 +2591,7 @@ Options::: link:#[back to top] -[[api-cat-repositories-6-6]] +[[api-cat-repositories-6-5]] === `cat.repositories` [source,js] @@ -2629,7 +2601,7 @@ client.cat.repositories([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-repositories.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2654,7 +2626,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-segments-6-6]] +[[api-cat-segments-6-5]] === `cat.segments` [source,js] @@ -2664,7 +2636,7 @@ client.cat.segments([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-segments.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2702,7 +2674,7 @@ Options::: link:#[back to top] -[[api-cat-shards-6-6]] +[[api-cat-shards-6-5]] === `cat.shards` [source,js] @@ -2712,7 +2684,7 @@ client.cat.shards([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-shards.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2754,7 +2726,7 @@ Options::: link:#[back to top] -[[api-cat-snapshots-6-6]] +[[api-cat-snapshots-6-5]] === `cat.snapshots` [source,js] @@ -2764,7 +2736,7 @@ client.cat.snapshots([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2791,7 +2763,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-tasks-6-6]] +[[api-cat-tasks-6-5]] === `cat.tasks` [source,js] @@ -2801,7 +2773,7 @@ client.cat.tasks([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2830,7 +2802,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-templates-6-6]] +[[api-cat-templates-6-5]] === `cat.templates` [source,js] @@ -2840,7 +2812,7 @@ client.cat.templates([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2867,7 +2839,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cat-threadpool-6-6]] +[[api-cat-threadpool-6-5]] === `cat.threadPool` [source,js] @@ -2877,7 +2849,7 @@ client.cat.threadPool([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat-thread-pool.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2914,7 +2886,7 @@ Options::: link:#[back to top] -[[api-cluster-allocationexplain-6-6]] +[[api-cluster-allocationexplain-6-5]] === `cluster.allocationExplain` [source,js] @@ -2924,7 +2896,7 @@ client.cluster.allocationExplain([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-allocation-explain.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2937,11 +2909,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `includeDiskInfo`:: <> -- Return information about disk usage and shard sizes (default: false) `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-allocation-explain.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-cluster-getsettings-6-6]] +[[api-cluster-getsettings-6-5]] === `cluster.getSettings` [source,js] @@ -2951,7 +2923,7 @@ client.cluster.getSettings([params, [callback]]) Get cluster settings (previously set with `putSettings()`) -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -2970,7 +2942,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cluster-health-6-6]] +[[api-cluster-health-6-5]] === `cluster.health` [source,js] @@ -2980,7 +2952,7 @@ client.cluster.health([params, [callback]]) Get a very simple status on the health of the cluster. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-health.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3031,7 +3003,7 @@ Options::: link:#[back to top] -[[api-cluster-pendingtasks-6-6]] +[[api-cluster-pendingtasks-6-5]] === `cluster.pendingTasks` [source,js] @@ -3041,7 +3013,7 @@ client.cluster.pendingTasks([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-pending.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3056,7 +3028,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-cluster-putsettings-6-6]] +[[api-cluster-putsettings-6-5]] === `cluster.putSettings` [source,js] @@ -3066,7 +3038,7 @@ client.cluster.putSettings([params, [callback]]) Update cluster wide specific settings. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-update-settings.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3081,11 +3053,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `timeout`:: <> -- Explicit operation timeout `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-update-settings.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-cluster-remoteinfo-6-6]] +[[api-cluster-remoteinfo-6-5]] === `cluster.remoteInfo` [source,js] @@ -3095,13 +3067,13 @@ client.cluster.remoteInfo([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-remote-info.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-remote-info.html[the elasticsearch docs] for more information pertaining to this method. // no examples -[[api-cluster-reroute-6-6]] +[[api-cluster-reroute-6-5]] === `cluster.reroute` [source,js] @@ -3111,7 +3083,7 @@ client.cluster.reroute([params, [callback]]) Explicitly execute a cluster reroute allocation command including specific commands. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-reroute.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3132,11 +3104,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `timeout`:: <> -- Explicit operation timeout `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-reroute.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-cluster-state-6-6]] +[[api-cluster-state-6-5]] === `cluster.state` [source,js] @@ -3146,7 +3118,7 @@ client.cluster.state([params, [callback]]) Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-state.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3160,10 +3132,6 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc <> -- Specify timeout for connection to master `flatSettings`:: <> -- Return settings in flat format (default: false) -`waitForMetadataVersion`:: -<> -- Wait for the metadata version to be equal or greater than the specified metadata version -`waitForTimeout`:: -<> -- The maximum time to wait for wait_for_metadata_version before timing out `ignoreUnavailable`:: <> -- Whether specified concrete indices should be ignored when unavailable (missing or closed) `allowNoIndices`:: @@ -3183,7 +3151,7 @@ Options::: link:#[back to top] -[[api-cluster-stats-6-6]] +[[api-cluster-stats-6-5]] === `cluster.stats` [source,js] @@ -3193,7 +3161,7 @@ client.cluster.stats([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-stats.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3210,7 +3178,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-indices-analyze-6-6]] +[[api-indices-analyze-6-5]] === `indices.analyze` [source,js] @@ -3220,7 +3188,7 @@ client.indices.analyze([params, [callback]]) Perform the analysis process on a text and return the tokens breakdown of the text. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-analyze.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3231,11 +3199,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `index`:: <> -- The name of the index to scope the operation `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-analyze.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-clearcache-6-6]] +[[api-indices-clearcache-6-5]] === `indices.clearCache` [source,js] @@ -3245,7 +3213,7 @@ client.indices.clearCache([params, [callback]]) Clear either all caches or specific cached associated with one ore more indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-clearcache.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3280,11 +3248,11 @@ Options::: `request`:: <> -- Clear request cache `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-clearcache.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-close-6-6]] +[[api-indices-close-6-5]] === `indices.close` [source,js] @@ -3295,7 +3263,7 @@ client.indices.close([params, [callback]]) Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3322,11 +3290,11 @@ Options::: `index`:: <>, <>, <> -- A comma separated list of indices to close `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-create-6-6]] +[[api-indices-create-6-5]] === `indices.create` [source,js] @@ -3336,7 +3304,7 @@ client.indices.create([params, [callback]]) Create an index in Elasticsearch. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-create-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3355,11 +3323,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `index`:: <> -- The name of the index `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-create-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-delete-6-6]] +[[api-indices-delete-6-5]] === `indices.delete` [source,js] @@ -3369,7 +3337,7 @@ client.indices.delete([params, [callback]]) Delete an index in Elasticsearch -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-delete-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3396,11 +3364,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-delete-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-deletealias-6-6]] +[[api-indices-deletealias-6-5]] === `indices.deleteAlias` [source,js] @@ -3410,7 +3378,7 @@ client.indices.deleteAlias([params, [callback]]) Delete a specific alias. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3427,11 +3395,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <>, <>, <> -- A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-deletetemplate-6-6]] +[[api-indices-deletetemplate-6-5]] === `indices.deleteTemplate` [source,js] @@ -3441,7 +3409,7 @@ client.indices.deleteTemplate([params, [callback]]) Delete an index template by its name. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3456,11 +3424,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <> -- The name of the template `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-exists-6-6]] +[[api-indices-exists-6-5]] === `indices.exists` [source,js] @@ -3470,7 +3438,7 @@ client.indices.exists([params, [callback]]) Return a boolean indicating whether given index exists. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-exists.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3499,11 +3467,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-exists.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-exists.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-existsalias-6-6]] +[[api-indices-existsalias-6-5]] === `indices.existsAlias` [source,js] @@ -3513,7 +3481,7 @@ client.indices.existsAlias([params, [callback]]) Return a boolean indicating whether given alias exists. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3540,11 +3508,11 @@ Options::: `name`:: <>, <>, <> -- A comma-separated list of alias names to return `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-existstemplate-6-6]] +[[api-indices-existstemplate-6-5]] === `indices.existsTemplate` [source,js] @@ -3554,7 +3522,7 @@ client.indices.existsTemplate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3571,11 +3539,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <>, <>, <> -- The comma separated names of the index templates `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-existstype-6-6]] +[[api-indices-existstype-6-5]] === `indices.existsType` [source,js] @@ -3585,7 +3553,7 @@ client.indices.existsType([params, [callback]]) Check if a type/types exists in an index/indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-types-exists.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3612,11 +3580,11 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of document types to check `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-types-exists.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-flush-6-6]] +[[api-indices-flush-6-5]] === `indices.flush` [source,js] @@ -3626,7 +3594,7 @@ client.indices.flush([params, [callback]]) Explicitly flush one or more indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-flush.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3653,11 +3621,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-flush.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-flush.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-flushsynced-6-6]] +[[api-indices-flushsynced-6-5]] === `indices.flushSynced` [source,js] @@ -3667,7 +3635,7 @@ client.indices.flushSynced([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-synced-flush.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3690,11 +3658,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-synced-flush.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-forcemerge-6-6]] +[[api-indices-forcemerge-6-5]] === `indices.forcemerge` [source,js] @@ -3704,7 +3672,7 @@ client.indices.forcemerge([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-forcemerge.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3733,11 +3701,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-forcemerge.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-get-6-6]] +[[api-indices-get-6-5]] === `indices.get` [source,js] @@ -3747,7 +3715,7 @@ client.indices.get([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-get-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3780,7 +3748,7 @@ Options::: link:#[back to top] -[[api-indices-getalias-6-6]] +[[api-indices-getalias-6-5]] === `indices.getAlias` [source,js] @@ -3790,7 +3758,7 @@ client.indices.getAlias([params, [callback]]) Retrieve a specified alias. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3819,7 +3787,7 @@ Options::: link:#[back to top] -[[api-indices-getfieldmapping-6-6]] +[[api-indices-getfieldmapping-6-5]] === `indices.getFieldMapping` [source,js] @@ -3829,7 +3797,7 @@ client.indices.getFieldMapping([params, [callback]]) Retrieve mapping definition of a specific field. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-get-field-mapping.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3862,7 +3830,7 @@ Options::: link:#[back to top] -[[api-indices-getmapping-6-6]] +[[api-indices-getmapping-6-5]] === `indices.getMapping` [source,js] @@ -3872,7 +3840,7 @@ client.indices.getMapping([params, [callback]]) Retrieve mapping definition of index or index/type. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-get-mapping.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3903,7 +3871,7 @@ Options::: link:#[back to top] -[[api-indices-getsettings-6-6]] +[[api-indices-getsettings-6-5]] === `indices.getSettings` [source,js] @@ -3913,7 +3881,7 @@ client.indices.getSettings([params, [callback]]) Retrieve settings for one or more (or all) indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-get-settings.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3948,7 +3916,7 @@ Options::: link:#[back to top] -[[api-indices-gettemplate-6-6]] +[[api-indices-gettemplate-6-5]] === `indices.getTemplate` [source,js] @@ -3958,7 +3926,7 @@ client.indices.getTemplate([params, [callback]]) Retrieve an index template by its name. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3977,7 +3945,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-indices-getupgrade-6-6]] +[[api-indices-getupgrade-6-5]] === `indices.getUpgrade` [source,js] @@ -3987,7 +3955,7 @@ client.indices.getUpgrade([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4012,7 +3980,7 @@ Options::: link:#[back to top] -[[api-indices-open-6-6]] +[[api-indices-open-6-5]] === `indices.open` [source,js] @@ -4022,7 +3990,7 @@ client.indices.open([params, [callback]]) Open a closed index, making it available for search. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-open-close.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4051,11 +4019,11 @@ Options::: `index`:: <>, <>, <> -- A comma separated list of indices to open `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-open-close.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-putalias-6-6]] +[[api-indices-putalias-6-5]] === `indices.putAlias` [source,js] @@ -4065,7 +4033,7 @@ client.indices.putAlias([params, [callback]]) Create an alias for a specific index/indices. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4082,11 +4050,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <> -- The name of the alias to be created or updated `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-putmapping-6-6]] +[[api-indices-putmapping-6-5]] === `indices.putMapping` [source,js] @@ -4096,7 +4064,7 @@ client.indices.putMapping([params, [callback]]) Register specific mapping definition for a specific type. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-put-mapping.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4127,11 +4095,11 @@ Options::: `type`:: <> -- The name of the document type `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-put-mapping.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-putsettings-6-6]] +[[api-indices-putsettings-6-5]] === `indices.putSettings` [source,js] @@ -4141,7 +4109,7 @@ client.indices.putSettings([params, [callback]]) Change specific index level settings in real time. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-update-settings.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4172,11 +4140,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-update-settings.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-puttemplate-6-6]] +[[api-indices-puttemplate-6-5]] === `indices.putTemplate` [source,js] @@ -4186,7 +4154,7 @@ client.indices.putTemplate([params, [callback]]) Create an index template that will automatically be applied to new indices created. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4207,11 +4175,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `name`:: <> -- The name of the template `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-templates.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-recovery-6-6]] +[[api-indices-recovery-6-5]] === `indices.recovery` [source,js] @@ -4221,7 +4189,7 @@ client.indices.recovery([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-recovery.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4238,7 +4206,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-indices-refresh-6-6]] +[[api-indices-refresh-6-5]] === `indices.refresh` [source,js] @@ -4248,7 +4216,7 @@ client.indices.refresh([params, [callback]]) Explicitly refresh one or more index, making all operations performed since the last refresh available for search. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-refresh.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4271,11 +4239,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-refresh.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-rollover-6-6]] +[[api-indices-rollover-6-5]] === `indices.rollover` [source,js] @@ -4285,7 +4253,7 @@ client.indices.rollover([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-rollover-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4306,11 +4274,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `newIndex`:: <> -- The name of the rollover index `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-rollover-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-segments-6-6]] +[[api-indices-segments-6-5]] === `indices.segments` [source,js] @@ -4320,7 +4288,7 @@ client.indices.segments([params, [callback]]) Retrieve low level segments information that a Lucene index (shard level) is built with. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-segments.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4347,7 +4315,7 @@ Options::: link:#[back to top] -[[api-indices-shardstores-6-6]] +[[api-indices-shardstores-6-5]] === `indices.shardStores` [source,js] @@ -4357,7 +4325,7 @@ client.indices.shardStores([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-shards-stores.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4384,7 +4352,7 @@ Options::: link:#[back to top] -[[api-indices-shrink-6-6]] +[[api-indices-shrink-6-5]] === `indices.shrink` [source,js] @@ -4394,7 +4362,7 @@ client.indices.shrink([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-shrink-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4415,11 +4383,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `target`:: <> -- The name of the target index to shrink into `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-shrink-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-split-6-6]] +[[api-indices-split-6-5]] === `indices.split` [source,js] @@ -4429,7 +4397,7 @@ client.indices.split([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-split-index.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-split-index.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4450,11 +4418,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `target`:: <> -- The name of the target index to split into `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-split-index.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-split-index.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-stats-6-6]] +[[api-indices-stats-6-5]] === `indices.stats` [source,js] @@ -4464,7 +4432,7 @@ client.indices.stats([params, [callback]]) Retrieve statistics on different operations happening on an index. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-stats.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4498,7 +4466,7 @@ Options::: link:#[back to top] -[[api-indices-updatealiases-6-6]] +[[api-indices-updatealiases-6-5]] === `indices.updateAliases` [source,js] @@ -4508,7 +4476,7 @@ client.indices.updateAliases([params, [callback]]) Update specified aliases. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for more information pertaining to this method. .Perform an atomic alias swap, for a rotating index [source,js] @@ -4533,11 +4501,11 @@ const response = await client.indices.updateAliases({ `masterTimeout`:: <> -- Specify timeout for connection to master `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-aliases.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-upgrade-6-6]] +[[api-indices-upgrade-6-5]] === `indices.upgrade` [source,js] @@ -4547,7 +4515,7 @@ client.indices.upgrade([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-upgrade.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4574,11 +4542,11 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-upgrade.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-indices-validatequery-6-6]] +[[api-indices-validatequery-6-5]] === `indices.validateQuery` [source,js] @@ -4588,7 +4556,7 @@ client.indices.validateQuery([params, [callback]]) Validate a potentially expensive query without executing it. -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-validate.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-validate.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4635,11 +4603,11 @@ Options::: `type`:: <>, <>, <> -- A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-validate.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-validate.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-ingest-deletepipeline-6-6]] +[[api-ingest-deletepipeline-6-5]] === `ingest.deletePipeline` [source,js] @@ -4649,7 +4617,7 @@ client.ingest.deletePipeline([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4664,11 +4632,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Pipeline ID `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-ingest-getpipeline-6-6]] +[[api-ingest-getpipeline-6-5]] === `ingest.getPipeline` [source,js] @@ -4678,7 +4646,7 @@ client.ingest.getPipeline([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4693,7 +4661,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-ingest-processorgrok-6-6]] +[[api-ingest-processorgrok-6-5]] === `ingest.processorGrok` [source,js] @@ -4703,13 +4671,13 @@ client.ingest.processorGrok([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples -[[api-ingest-putpipeline-6-6]] +[[api-ingest-putpipeline-6-5]] === `ingest.putPipeline` [source,js] @@ -4719,7 +4687,7 @@ client.ingest.putPipeline([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4734,11 +4702,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Pipeline ID `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-ingest-simulate-6-6]] +[[api-ingest-simulate-6-5]] === `ingest.simulate` [source,js] @@ -4748,7 +4716,7 @@ client.ingest.simulate([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4761,11 +4729,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `id`:: <> -- Pipeline ID `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.6/ingest.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/plugins/6.5/ingest.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-nodes-hotthreads-6-6]] +[[api-nodes-hotthreads-6-5]] === `nodes.hotThreads` [source,js] @@ -4775,7 +4743,7 @@ client.nodes.hotThreads([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-nodes-hot-threads.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4805,7 +4773,7 @@ Options::: link:#[back to top] -[[api-nodes-info-6-6]] +[[api-nodes-info-6-5]] === `nodes.info` [source,js] @@ -4815,7 +4783,7 @@ client.nodes.info([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-nodes-info.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4834,7 +4802,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-nodes-reloadsecuresettings-6-6]] +[[api-nodes-reloadsecuresettings-6-5]] === `nodes.reloadSecureSettings` [source,js] @@ -4844,7 +4812,7 @@ client.nodes.reloadSecureSettings([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4857,11 +4825,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `nodeId`:: <>, <>, <> -- A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/secure-settings.html#reloadable-secure-settings[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-nodes-stats-6-6]] +[[api-nodes-stats-6-5]] === `nodes.stats` [source,js] @@ -4871,7 +4839,7 @@ client.nodes.stats([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-nodes-stats.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4909,7 +4877,7 @@ Options::: link:#[back to top] -[[api-nodes-usage-6-6]] +[[api-nodes-usage-6-5]] === `nodes.usage` [source,js] @@ -4919,7 +4887,7 @@ client.nodes.usage([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-nodes-usage.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cluster-nodes-usage.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4936,7 +4904,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-snapshot-create-6-6]] +[[api-snapshot-create-6-5]] === `snapshot.create` [source,js] @@ -4946,7 +4914,7 @@ client.snapshot.create([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4963,11 +4931,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `snapshot`:: <> -- A snapshot name `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-snapshot-createrepository-6-6]] +[[api-snapshot-createrepository-6-5]] === `snapshot.createRepository` [source,js] @@ -4977,7 +4945,7 @@ client.snapshot.createRepository([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -4994,11 +4962,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `repository`:: <> -- A repository name `body`:: -<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- The request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-snapshot-delete-6-6]] +[[api-snapshot-delete-6-5]] === `snapshot.delete` [source,js] @@ -5008,7 +4976,7 @@ client.snapshot.delete([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5023,11 +4991,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `snapshot`:: <> -- A snapshot name `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-snapshot-deleterepository-6-6]] +[[api-snapshot-deleterepository-6-5]] === `snapshot.deleteRepository` [source,js] @@ -5037,7 +5005,7 @@ client.snapshot.deleteRepository([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5052,11 +5020,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `repository`:: <>, <>, <> -- A comma-separated list of repository names `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-snapshot-get-6-6]] +[[api-snapshot-get-6-5]] === `snapshot.get` [source,js] @@ -5066,7 +5034,7 @@ client.snapshot.get([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5087,7 +5055,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-snapshot-getrepository-6-6]] +[[api-snapshot-getrepository-6-5]] === `snapshot.getRepository` [source,js] @@ -5097,7 +5065,7 @@ client.snapshot.getRepository([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5114,7 +5082,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-snapshot-restore-6-6]] +[[api-snapshot-restore-6-5]] === `snapshot.restore` [source,js] @@ -5124,7 +5092,7 @@ client.snapshot.restore([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5141,11 +5109,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `snapshot`:: <> -- A snapshot name `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-snapshot-status-6-6]] +[[api-snapshot-status-6-5]] === `snapshot.status` [source,js] @@ -5155,7 +5123,7 @@ client.snapshot.status([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5174,7 +5142,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-snapshot-verifyrepository-6-6]] +[[api-snapshot-verifyrepository-6-5]] === `snapshot.verifyRepository` [source,js] @@ -5184,7 +5152,7 @@ client.snapshot.verifyRepository([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5199,11 +5167,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `repository`:: <> -- A repository name `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-snapshots.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-tasks-cancel-6-6]] +[[api-tasks-cancel-6-5]] === `tasks.cancel` [source,js] @@ -5213,7 +5181,7 @@ client.tasks.cancel([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5230,11 +5198,11 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc `taskId`:: <> -- Cancel the task with specified task id (node_id:task_number) `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] -[[api-tasks-get-6-6]] +[[api-tasks-get-6-5]] === `tasks.get` [source,js] @@ -5244,7 +5212,7 @@ client.tasks.get([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -5261,7 +5229,7 @@ Check the *<>* and https://www.elastic.co/guide/en/elasticsearc link:#[back to top] -[[api-tasks-list-6-6]] +[[api-tasks-list-6-5]] === `tasks.list` [source,js] @@ -5271,7 +5239,7 @@ client.tasks.list([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/tasks.html[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/6.5/tasks.html[the elasticsearch docs] for more information pertaining to this method. // no examples diff --git a/docs/configuration.asciidoc b/docs/configuration.asciidoc index 490170167..6f5732ce6 100644 --- a/docs/configuration.asciidoc +++ b/docs/configuration.asciidoc @@ -52,7 +52,7 @@ 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 ::: `'6.5'` +Default ::: `'6.6'` Options in node ::: * `'6.6'` @@ -63,16 +63,12 @@ Options in node ::: * `'6.1'` * `'6.0'` * `'5.6'` - * `'5.5'` - * `'5.4'` - * `'5.3'` - * `'5.2'` - * `'5.1'` - * `'5.0'` * `'2.4'` * `'1.7'` * `'0.90'` - * `'6.x'` (unstable) + * `'6.7'` (unstable) + * `'7.0'` (unstable) + * `'7.x'` (unstable) * `'master'` (unstable) Options in the browser ::: @@ -81,7 +77,9 @@ Options in the browser ::: * `'6.4'` * `'6.3'` * `'6.2'` - * `'6.x'` (unstable) + * `'6.7'` (unstable) + * `'7.0'` (unstable) + * `'7.x'` (unstable) * `'master'` (unstable) diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 7682f8d6d..db41778bb 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -20,10 +20,10 @@ include::logging.asciidoc[] include::development.asciidoc[] -include::api_methods_6_6.asciidoc[] - include::api_methods.asciidoc[] +include::api_methods_6_5.asciidoc[] + include::api_methods_6_4.asciidoc[] include::api_methods_6_3.asciidoc[] @@ -36,18 +36,6 @@ include::api_methods_6_0.asciidoc[] include::api_methods_5_6.asciidoc[] -include::api_methods_5_5.asciidoc[] - -include::api_methods_5_4.asciidoc[] - -include::api_methods_5_3.asciidoc[] - -include::api_methods_5_2.asciidoc[] - -include::api_methods_5_1.asciidoc[] - -include::api_methods_5_0.asciidoc[] - include::api_methods_2_4.asciidoc[] include::api_methods_1_7.asciidoc[] diff --git a/package.json b/package.json index 7b2bb8ac6..d91ff39d4 100644 --- a/package.json +++ b/package.json @@ -39,18 +39,14 @@ "6.1", "6.0", "5.6", - "5.5", - "5.4", - "5.3", - "5.2", - "5.1", - "5.0", "2.4", "1.7", "0.90" ], "unstable_es_branches": [ "6.7", + "7.0", + "7.x", "master" ] }, diff --git a/src/lib/apis/5_0.js b/src/lib/apis/5_0.js deleted file mode 100644 index a13dcaac7..000000000 --- a/src/lib/apis/5_0.js +++ /dev/null @@ -1,7012 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('lodash').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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} 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 {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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 - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} params.parent - ID of the parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} params.parent - ID of parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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/5.0/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the delete-by-query is complete. - * @param {<>} 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 {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} 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 {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} 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 {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} 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 {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} 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: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} 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 {<>, <>, <>} 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](https://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/5.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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/5.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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/5.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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/5.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} 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' - }, - routing: { - type: 'string' - }, - _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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>} 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 {<>} [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 {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} 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 {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} 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 {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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 {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} 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 {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} 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](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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/5.0/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {<>} 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/5.0/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} 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: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: groovy) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} 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 {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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/5.0/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the update by query operation is complete. - * @param {<>} 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 {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' -}); diff --git a/src/lib/apis/5_1.js b/src/lib/apis/5_1.js deleted file mode 100644 index 972f874bb..000000000 --- a/src/lib/apis/5_1.js +++ /dev/null @@ -1,7148 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('lodash').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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} 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 {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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 - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} 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' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} params.parent - ID of the parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} params.parent - ID of parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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/5.1/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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' - }, - slices: { - type: 'integer', - 'default': 1 - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} 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 {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} 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 {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} 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 {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} 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: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} 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 {<>, <>, <>} 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' - }, - 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](https://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/5.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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/5.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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/5.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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/5.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} 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' - }, - routing: { - type: 'string' - }, - _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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>} 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 {<>} [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 {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} 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 {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} 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 {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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 {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} 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 {<>, <>, <>} 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' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} 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](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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/5.1/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -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' - }, - slices: { - type: 'integer', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} 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: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} 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 {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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/5.1/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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' - }, - slices: { - type: 'integer', - 'default': 1 - } - }, - 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' -}); diff --git a/src/lib/apis/5_2.js b/src/lib/apis/5_2.js deleted file mode 100644 index 4bce7f17c..000000000 --- a/src/lib/apis/5_2.js +++ /dev/null @@ -1,7149 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('lodash').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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} 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 {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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 - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id', - castToArray: true - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} 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' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} params.parent - ID of the parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} params.parent - ID of parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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/5.2/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} 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 {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} 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 {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} 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 {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} 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: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} 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 {<>, <>, <>} 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' - }, - 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](https://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/5.2/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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/5.2/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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/5.2/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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/5.2/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} 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' - }, - routing: { - type: 'string' - }, - _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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>} 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 {<>} [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 {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} 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 {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} 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 {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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 {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} 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 {<>, <>, <>} 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' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} 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](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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/5.2/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -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' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} 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: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} 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 {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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/5.2/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - 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' -}); diff --git a/src/lib/apis/5_3.js b/src/lib/apis/5_3.js deleted file mode 100644 index 8c47f8661..000000000 --- a/src/lib/apis/5_3.js +++ /dev/null @@ -1,7134 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('lodash').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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} 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 {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} 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 - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id', - castToArray: true - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} 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' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} params.parent - ID of the parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} params.parent - ID of parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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/5.3/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ] -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} 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 {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} 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 {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} 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 {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} 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 {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} 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' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} 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' - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} 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: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} 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 {<>, <>, <>} 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' - }, - 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](https://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/5.3/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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/5.3/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} 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/5.3/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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/5.3/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} 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' - }, - routing: { - type: 'string' - }, - _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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>} 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 {<>} [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 {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} 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 {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} 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 {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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 {<>, <>, <>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} 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 {<>, <>, <>} 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' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} 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](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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/5.3/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} 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: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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 {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} 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 {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} 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/5.3/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} 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' - }, - 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': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - 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' -}); diff --git a/src/lib/apis/6_x.js b/src/lib/apis/6_7.js similarity index 96% rename from src/lib/apis/6_x.js rename to src/lib/apis/6_7.js index 02d84e1c9..cc29d2533 100644 --- a/src/lib/apis/6_x.js +++ b/src/lib/apis/6_7.js @@ -14,7 +14,7 @@ var api = module.exports = {}; api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; /** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-bulk.html) request + * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-bulk.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -103,7 +103,7 @@ api.bulk = ca({ api.cat = namespace(); /** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat.html) request + * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -158,7 +158,7 @@ api.cat.prototype.aliases = ca({ }); /** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-allocation.html) request + * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-allocation.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -230,7 +230,7 @@ api.cat.prototype.allocation = ca({ }); /** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-count.html) request + * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-count.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -285,7 +285,7 @@ api.cat.prototype.count = ca({ }); /** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-fielddata.html) request + * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-fielddata.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -360,7 +360,7 @@ api.cat.prototype.fielddata = ca({ }); /** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-health.html) request + * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-health.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -409,7 +409,7 @@ api.cat.prototype.health = ca({ }); /** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat.html) request + * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.help - Return help information @@ -431,7 +431,7 @@ api.cat.prototype.help = ca({ }); /** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-indices.html) request + * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-indices.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -511,7 +511,7 @@ api.cat.prototype.indices = ca({ }); /** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-master.html) request + * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-master.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -555,7 +555,7 @@ api.cat.prototype.master = ca({ }); /** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-nodeattrs.html) request + * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-nodeattrs.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -599,7 +599,7 @@ api.cat.prototype.nodeattrs = ca({ }); /** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-nodes.html) request + * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-nodes.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -648,7 +648,7 @@ api.cat.prototype.nodes = ca({ }); /** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-pending-tasks.html) request + * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-pending-tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -692,7 +692,7 @@ api.cat.prototype.pendingTasks = ca({ }); /** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-plugins.html) request + * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-plugins.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -736,7 +736,7 @@ api.cat.prototype.plugins = ca({ }); /** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-recovery.html) request + * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-recovery.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -804,7 +804,7 @@ api.cat.prototype.recovery = ca({ }); /** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-repositories.html) request + * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-repositories.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -849,7 +849,7 @@ api.cat.prototype.repositories = ca({ }); /** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-segments.html) request + * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-segments.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -912,7 +912,7 @@ api.cat.prototype.segments = ca({ }); /** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-shards.html) request + * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-shards.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -984,7 +984,7 @@ api.cat.prototype.shards = ca({ }); /** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-snapshots.html) request + * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1041,7 +1041,7 @@ api.cat.prototype.snapshots = ca({ }); /** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/tasks.html) request + * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1094,7 +1094,7 @@ api.cat.prototype.tasks = ca({ }); /** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-templates.html) request + * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1149,7 +1149,7 @@ api.cat.prototype.templates = ca({ }); /** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-thread-pool.html) request + * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cat-thread-pool.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1216,7 +1216,7 @@ api.cat.prototype.threadPool = ca({ }); /** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-request-scroll.html) request + * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear @@ -1245,7 +1245,7 @@ api.clearScroll = ca({ api.cluster = namespace(); /** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-allocation-explain.html) request + * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-allocation-explain.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) @@ -1269,7 +1269,7 @@ api.cluster.prototype.allocationExplain = ca({ }); /** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-update-settings.html) request + * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1302,7 +1302,7 @@ api.cluster.prototype.getSettings = ca({ }); /** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-health.html) request + * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-health.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} [params.level=cluster] - Specify the level of detail for returned information @@ -1393,7 +1393,7 @@ api.cluster.prototype.health = ca({ }); /** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-pending.html) request + * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-pending.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -1415,7 +1415,7 @@ api.cluster.prototype.pendingTasks = ca({ }); /** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-update-settings.html) request + * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1444,7 +1444,7 @@ api.cluster.prototype.putSettings = ca({ }); /** - * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-remote-info.html) request + * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-remote-info.html) request * * @param {Object} params - An object with parameters used to carry out this action */ @@ -1455,7 +1455,7 @@ api.cluster.prototype.remoteInfo = ca({ }); /** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-reroute.html) request + * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-reroute.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.dryRun - Simulate the operation only and return the resulting state @@ -1505,7 +1505,7 @@ api.cluster.prototype.reroute = ca({ }); /** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-state.html) request + * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-state.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -1607,7 +1607,7 @@ api.cluster.prototype.state = ca({ }); /** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-stats.html) request + * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1640,7 +1640,7 @@ api.cluster.prototype.stats = ca({ }); /** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-count.html) request + * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-count.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -1753,7 +1753,7 @@ api.count = ca({ }); /** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-index_.html) request + * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -1828,7 +1828,7 @@ api.create = ca({ }); /** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-delete.html) request + * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-delete.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -1908,7 +1908,7 @@ api['delete'] = ca({ }); /** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-delete-by-query.html) request + * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-delete-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string @@ -2111,7 +2111,7 @@ api.deleteByQuery = ca({ }); /** - * Perform a [deleteByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-delete-by-query.html) request + * Perform a [deleteByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-delete-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. @@ -2137,7 +2137,7 @@ api.deleteByQueryRethrottle = ca({ }); /** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-scripting.html) request + * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-scripting.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -2166,7 +2166,7 @@ api.deleteScript = ca({ }); /** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-get.html) request + * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -2248,7 +2248,7 @@ api.exists = ca({ }); /** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-get.html) request + * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.parent - The ID of the parent document @@ -2325,7 +2325,7 @@ api.existsSource = ca({ }); /** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-explain.html) request + * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-explain.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) @@ -2415,7 +2415,7 @@ api.explain = ca({ }); /** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-field-caps.html) request + * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-field-caps.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.fields - A comma-separated list of field names @@ -2466,7 +2466,7 @@ api.fieldCaps = ca({ }); /** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-get.html) request + * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -2557,7 +2557,7 @@ api.get = ca({ }); /** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-scripting.html) request + * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-scripting.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Specify timeout for connection to master @@ -2581,7 +2581,7 @@ api.getScript = ca({ }); /** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-get.html) request + * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.parent - The ID of the parent document @@ -2657,7 +2657,7 @@ api.getSource = ca({ }); /** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-index_.html) request + * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -2767,7 +2767,7 @@ api.index = ca({ api.indices = namespace(); /** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-analyze.html) request + * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-analyze.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.index - The name of the index to scope the operation @@ -2795,7 +2795,7 @@ api.indices.prototype.analyze = ca({ }); /** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-clearcache.html) request + * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-clearcache.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.fieldData - Clear field data. This is deprecated. Prefer `fielddata`. @@ -2871,7 +2871,7 @@ api.indices.prototype.clearCache = ca({ }); /** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-open-close.html) request + * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -2922,7 +2922,7 @@ api.indices.prototype.close = ca({ }); /** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-create-index.html) request + * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-create-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. @@ -2966,7 +2966,7 @@ api.indices.prototype.create = ca({ }); /** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-delete-index.html) request + * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-delete-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -3017,7 +3017,7 @@ api.indices.prototype['delete'] = ca({ }); /** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request + * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit timestamp for the document @@ -3050,7 +3050,7 @@ api.indices.prototype.deleteAlias = ca({ }); /** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-templates.html) request + * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -3079,7 +3079,7 @@ api.indices.prototype.deleteTemplate = ca({ }); /** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-exists.html) request + * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-exists.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -3136,7 +3136,7 @@ api.indices.prototype.exists = ca({ }); /** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request + * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3196,7 +3196,7 @@ api.indices.prototype.existsAlias = ca({ }); /** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-templates.html) request + * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -3230,7 +3230,7 @@ api.indices.prototype.existsTemplate = ca({ }); /** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-types-exists.html) request + * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-types-exists.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3280,7 +3280,7 @@ api.indices.prototype.existsType = ca({ }); /** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-flush.html) request + * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-flush.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -3336,7 +3336,7 @@ api.indices.prototype.flush = ca({ }); /** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-synced-flush.html) request + * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-synced-flush.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3383,7 +3383,7 @@ api.indices.prototype.flushSynced = ca({ }); /** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-forcemerge.html) request + * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-forcemerge.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) @@ -3444,9 +3444,10 @@ api.indices.prototype.forcemerge = ca({ }); /** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-get-index.html) request + * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-get-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether to add the type name to the response (default: true) * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) @@ -3458,6 +3459,10 @@ api.indices.prototype.forcemerge = ca({ */ api.indices.prototype.get = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, local: { type: 'boolean' }, @@ -3505,7 +3510,7 @@ api.indices.prototype.get = ca({ }); /** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request + * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3575,9 +3580,10 @@ api.indices.prototype.getAlias = ca({ }); /** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-get-field-mapping.html) request + * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-get-field-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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) @@ -3589,6 +3595,10 @@ api.indices.prototype.getAlias = ca({ */ api.indices.prototype.getFieldMapping = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, includeDefaults: { type: 'boolean', name: 'include_defaults' @@ -3665,7 +3675,7 @@ api.indices.prototype.getFieldMapping = ca({ }); /** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-get-mapping.html) request + * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-get-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.includeTypeName - Whether to add the type name to the response. @@ -3745,7 +3755,7 @@ api.indices.prototype.getMapping = ca({ }); /** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-get-settings.html) request + * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-get-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Specify timeout for connection to master @@ -3834,9 +3844,10 @@ api.indices.prototype.getSettings = ca({ }); /** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-templates.html) request + * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.flatSettings - Return settings in flat format (default: false) * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -3844,6 +3855,10 @@ api.indices.prototype.getSettings = ca({ */ api.indices.prototype.getTemplate = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, flatSettings: { type: 'boolean', name: 'flat_settings' @@ -3872,7 +3887,7 @@ api.indices.prototype.getTemplate = ca({ }); /** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-upgrade.html) request + * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3918,7 +3933,7 @@ api.indices.prototype.getUpgrade = ca({ }); /** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-open-close.html) request + * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -3974,7 +3989,7 @@ api.indices.prototype.open = ca({ }); /** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request + * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit timestamp for the document @@ -4007,7 +4022,7 @@ api.indices.prototype.putAlias = ca({ }); /** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-put-mapping.html) request + * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-put-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. @@ -4091,7 +4106,7 @@ api.indices.prototype.putMapping = ca({ }); /** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-update-settings.html) request + * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Specify timeout for connection to master @@ -4158,9 +4173,10 @@ api.indices.prototype.putSettings = ca({ }); /** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-templates.html) request + * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one * @param {<>} params.timeout - Explicit operation timeout @@ -4170,6 +4186,10 @@ api.indices.prototype.putSettings = ca({ */ api.indices.prototype.putTemplate = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, order: { type: 'number' }, @@ -4202,7 +4222,7 @@ api.indices.prototype.putTemplate = ca({ }); /** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-recovery.html) request + * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-recovery.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.detailed - Whether to display detailed information about shard recovery @@ -4237,7 +4257,7 @@ api.indices.prototype.recovery = ca({ }); /** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-refresh.html) request + * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-refresh.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -4284,9 +4304,10 @@ api.indices.prototype.refresh = ca({ }); /** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-rollover-index.html) request + * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-rollover-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be included in the body of the mappings. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false * @param {<>} params.masterTimeout - Specify timeout for connection to master @@ -4296,6 +4317,10 @@ api.indices.prototype.refresh = ca({ */ api.indices.prototype.rollover = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, timeout: { type: 'time' }, @@ -4337,7 +4362,7 @@ api.indices.prototype.rollover = ca({ }); /** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-segments.html) request + * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-segments.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -4388,7 +4413,7 @@ api.indices.prototype.segments = ca({ }); /** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-shards-stores.html) request + * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-shards-stores.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for @@ -4444,7 +4469,7 @@ api.indices.prototype.shardStores = ca({ }); /** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-shrink-index.html) request + * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-shrink-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.copySettings - whether or not to copy settings from the source index (defaults to false) @@ -4487,7 +4512,7 @@ api.indices.prototype.shrink = ca({ }); /** - * Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-split-index.html) request + * Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-split-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.copySettings - whether or not to copy settings from the source index (defaults to false) @@ -4530,7 +4555,7 @@ api.indices.prototype.split = ca({ }); /** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-stats.html) request + * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) @@ -4648,7 +4673,7 @@ api.indices.prototype.stats = ca({ }); /** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request + * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Request timeout @@ -4672,7 +4697,7 @@ api.indices.prototype.updateAliases = ca({ }); /** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-upgrade.html) request + * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -4729,7 +4754,7 @@ api.indices.prototype.upgrade = ca({ }); /** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-validate.html) request + * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-validate.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.explain - Return detailed information about the error @@ -4845,7 +4870,7 @@ api.info = ca({ api.ingest = namespace(); /** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request + * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.7/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -4874,7 +4899,7 @@ api.ingest.prototype.deletePipeline = ca({ }); /** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request + * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.7/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -4903,7 +4928,7 @@ api.ingest.prototype.getPipeline = ca({ }); /** - * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request + * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/6.7/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action */ @@ -4914,7 +4939,7 @@ api.ingest.prototype.processorGrok = ca({ }); /** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request + * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.7/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -4944,7 +4969,7 @@ api.ingest.prototype.putPipeline = ca({ }); /** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request + * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/6.7/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline @@ -4975,7 +5000,7 @@ api.ingest.prototype.simulate = ca({ }); /** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-multi-get.html) request + * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-multi-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -5048,7 +5073,7 @@ api.mget = ca({ }); /** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-multi-search.html) request + * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.searchType - Search operation type @@ -5126,7 +5151,7 @@ api.msearch = ca({ }); /** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-multi-search.html) request + * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.searchType - Search operation type @@ -5192,7 +5217,7 @@ api.msearchTemplate = ca({ }); /** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-multi-termvectors.html) request + * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-multi-termvectors.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body @@ -5308,7 +5333,7 @@ api.mtermvectors = ca({ api.nodes = namespace(); /** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-nodes-hot-threads.html) request + * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-nodes-hot-threads.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.interval - The interval for the second sampling of threads @@ -5362,7 +5387,7 @@ api.nodes.prototype.hotThreads = ca({ }); /** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-nodes-info.html) request + * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-nodes-info.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -5437,7 +5462,7 @@ api.nodes.prototype.info = ca({ }); /** - * Perform a [nodes.reloadSecureSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/secure-settings.html#reloadable-secure-settings) request + * Perform a [nodes.reloadSecureSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/secure-settings.html#reloadable-secure-settings) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -5466,7 +5491,7 @@ api.nodes.prototype.reloadSecureSettings = ca({ }); /** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-nodes-stats.html) request + * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-nodes-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) @@ -5666,7 +5691,7 @@ api.nodes.prototype.stats = ca({ }); /** - * Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-nodes-usage.html) request + * Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-nodes-usage.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -5734,7 +5759,7 @@ api.ping = ca({ }); /** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-scripting.html) request + * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-scripting.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -5781,7 +5806,7 @@ api.putScript = ca({ }); /** - * Perform a [rankEval](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-rank-eval.html) request + * Perform a [rankEval](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-rank-eval.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -5829,7 +5854,7 @@ api.rankEval = ca({ }); /** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-reindex.html) request + * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-reindex.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.refresh - Should the effected indexes be refreshed? @@ -5875,7 +5900,7 @@ api.reindex = ca({ }); /** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-reindex.html) request + * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-reindex.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. @@ -5901,7 +5926,7 @@ api.reindexRethrottle = ca({ }); /** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-template.html) request + * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-template.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.id - The id of the stored search template @@ -5924,7 +5949,7 @@ api.renderSearchTemplate = ca({ }); /** - * Perform a [scriptsPainlessExecute](https://www.elastic.co/guide/en/elasticsearch/painless/6.x/painless-execute-api.html) request + * Perform a [scriptsPainlessExecute](https://www.elastic.co/guide/en/elasticsearch/painless/6.7/painless-execute-api.html) request * * @param {Object} params - An object with parameters used to carry out this action */ @@ -5936,7 +5961,7 @@ api.scriptsPainlessExecute = ca({ }); /** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-request-scroll.html) request + * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search @@ -5979,7 +6004,7 @@ api.scroll = ca({ }); /** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-search.html) request + * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string @@ -6017,6 +6042,7 @@ api.scroll = ca({ * @param {<>} [params.allowPartialSearchResults=true] - Indicate if an error should be returned if there is a partial search failure or timeout * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response * @param {<>} params.version - Specify whether to return document version as part of a hit + * @param {<>} params.seqNoPrimaryTerm - Specify whether to return sequence number and primary term of the last modification of each hit * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests @@ -6175,6 +6201,10 @@ api.search = ca({ version: { type: 'boolean' }, + seqNoPrimaryTerm: { + type: 'boolean', + name: 'seq_no_primary_term' + }, requestCache: { type: 'boolean', name: 'request_cache' @@ -6228,7 +6258,7 @@ api.search = ca({ }); /** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-shards.html) request + * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-shards.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) @@ -6287,7 +6317,7 @@ api.searchShards = ca({ }); /** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-template.html) request + * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-template.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -6396,7 +6426,7 @@ api.searchTemplate = ca({ api.snapshot = namespace(); /** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6431,7 +6461,7 @@ api.snapshot.prototype.create = ca({ }); /** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6465,7 +6495,7 @@ api.snapshot.prototype.createRepository = ca({ }); /** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6494,7 +6524,7 @@ api.snapshot.prototype['delete'] = ca({ }); /** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6523,7 +6553,7 @@ api.snapshot.prototype.deleteRepository = ca({ }); /** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6560,7 +6590,7 @@ api.snapshot.prototype.get = ca({ }); /** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6593,7 +6623,7 @@ api.snapshot.prototype.getRepository = ca({ }); /** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6628,7 +6658,7 @@ api.snapshot.prototype.restore = ca({ }); /** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6674,7 +6704,7 @@ api.snapshot.prototype.status = ca({ }); /** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request + * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6705,7 +6735,7 @@ api.snapshot.prototype.verifyRepository = ca({ api.tasks = namespace(); /** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/tasks.html) request + * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.nodes - 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 @@ -6743,7 +6773,7 @@ api.tasks.prototype.cancel = ca({ }); /** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/tasks.html) request + * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) @@ -6771,7 +6801,7 @@ api.tasks.prototype.get = ca({ }); /** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/tasks.html) request + * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.nodes - 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 @@ -6821,7 +6851,7 @@ api.tasks.prototype.list = ca({ }); /** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-termvectors.html) request + * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-termvectors.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. @@ -6934,7 +6964,7 @@ api.termvectors = ca({ }); /** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-update.html) request + * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-update.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -6948,6 +6978,8 @@ api.termvectors = ca({ * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) * @param {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.ifSeqNo - only perform the update operation if the last operation that has changed the document has the specified sequence number + * @param {<>} params.ifPrimaryTerm - only perform the update operation if the last operation that has changed the document has the specified primary term * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - Document ID @@ -6999,6 +7031,14 @@ api.update = ca({ timeout: { type: 'time' }, + ifSeqNo: { + type: 'number', + name: 'if_seq_no' + }, + ifPrimaryTerm: { + type: 'number', + name: 'if_primary_term' + }, version: { type: 'number' }, @@ -7030,7 +7070,7 @@ api.update = ca({ }); /** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-update-by-query.html) request + * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-update-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string @@ -7241,7 +7281,7 @@ api.updateByQuery = ca({ }); /** - * Perform a [updateByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-update-by-query.html) request + * Perform a [updateByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docs-update-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. diff --git a/src/lib/apis/5_5.js b/src/lib/apis/7_0.js similarity index 88% rename from src/lib/apis/5_5.js rename to src/lib/apis/7_0.js index 4308506f0..952691197 100644 --- a/src/lib/apis/5_5.js +++ b/src/lib/apis/7_0.js @@ -11,10 +11,10 @@ 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', 'remote', 'snapshot', 'tasks']; +api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; /** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-bulk.html) request + * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-bulk.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -22,10 +22,9 @@ api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'remote', 'sn * @param {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request * @param {<>, <>, <>} 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 {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request + * @param {<>, <>, <>} params._sourceExcludes - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request + * @param {<>, <>, <>} params._sourceIncludes - Default list of fields to extract and return from the _source field, can be overridden on each sub-request * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with * @param {<>} params.index - Default index for items which don't provide one */ @@ -53,19 +52,16 @@ api.bulk = ca({ type: { type: 'string' }, - fields: { - type: 'list' - }, _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, pipeline: { type: 'string' @@ -103,7 +99,7 @@ api.bulk = ca({ api.cat = namespace(); /** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat.html) request + * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -158,7 +154,7 @@ api.cat.prototype.aliases = ca({ }); /** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-allocation.html) request + * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-allocation.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -230,7 +226,7 @@ api.cat.prototype.allocation = ca({ }); /** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-count.html) request + * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-count.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -285,7 +281,7 @@ api.cat.prototype.count = ca({ }); /** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-fielddata.html) request + * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-fielddata.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -360,7 +356,7 @@ api.cat.prototype.fielddata = ca({ }); /** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-health.html) request + * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-health.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -409,7 +405,7 @@ api.cat.prototype.health = ca({ }); /** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat.html) request + * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.help - Return help information @@ -431,7 +427,7 @@ api.cat.prototype.help = ca({ }); /** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-indices.html) request + * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-indices.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -511,7 +507,7 @@ api.cat.prototype.indices = ca({ }); /** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-master.html) request + * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-master.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -555,7 +551,7 @@ api.cat.prototype.master = ca({ }); /** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-nodeattrs.html) request + * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-nodeattrs.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -599,7 +595,7 @@ api.cat.prototype.nodeattrs = ca({ }); /** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-nodes.html) request + * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-nodes.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -648,7 +644,7 @@ api.cat.prototype.nodes = ca({ }); /** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-pending-tasks.html) request + * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-pending-tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -692,7 +688,7 @@ api.cat.prototype.pendingTasks = ca({ }); /** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-plugins.html) request + * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-plugins.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -736,7 +732,7 @@ api.cat.prototype.plugins = ca({ }); /** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-recovery.html) request + * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-recovery.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -804,7 +800,7 @@ api.cat.prototype.recovery = ca({ }); /** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-repositories.html) request + * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-repositories.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -849,10 +845,11 @@ api.cat.prototype.repositories = ca({ }); /** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-segments.html) request + * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-segments.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml + * @param {<>} params.bytes - The unit in which to display byte values * @param {<>, <>, <>} params.h - Comma-separated list of column names to display * @param {<>} params.help - Return help information * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by @@ -864,6 +861,22 @@ api.cat.prototype.segments = ca({ format: { type: 'string' }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, h: { type: 'list' }, @@ -895,10 +908,11 @@ api.cat.prototype.segments = ca({ }); /** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-shards.html) request + * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-shards.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml + * @param {<>} params.bytes - The unit in which to display byte values * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node * @param {<>, <>, <>} params.h - Comma-separated list of column names to display @@ -912,6 +926,22 @@ api.cat.prototype.shards = ca({ format: { type: 'string' }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, local: { type: 'boolean' }, @@ -950,7 +980,7 @@ api.cat.prototype.shards = ca({ }); /** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-snapshots.html) request + * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1007,14 +1037,13 @@ api.cat.prototype.snapshots = ca({ }); /** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html) request + * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. * @param {<>, <>, <>} params.h - Comma-separated list of column names to display * @param {<>} params.help - Return help information @@ -1036,10 +1065,6 @@ api.cat.prototype.tasks = ca({ detailed: { type: 'boolean' }, - parentNode: { - type: 'string', - name: 'parent_node' - }, parentTask: { type: 'number', name: 'parent_task' @@ -1065,7 +1090,7 @@ api.cat.prototype.tasks = ca({ }); /** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-templates.html) request + * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1120,7 +1145,7 @@ api.cat.prototype.templates = ca({ }); /** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-thread-pool.html) request + * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-thread-pool.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1187,7 +1212,7 @@ api.cat.prototype.threadPool = ca({ }); /** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-request-scroll.html) request + * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear @@ -1216,7 +1241,7 @@ api.clearScroll = ca({ api.cluster = namespace(); /** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-allocation-explain.html) request + * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-allocation-explain.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) @@ -1240,7 +1265,7 @@ api.cluster.prototype.allocationExplain = ca({ }); /** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-update-settings.html) request + * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1273,7 +1298,7 @@ api.cluster.prototype.getSettings = ca({ }); /** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-health.html) request + * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-health.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} [params.level=cluster] - Specify the level of detail for returned information @@ -1284,6 +1309,7 @@ api.cluster.prototype.getSettings = ca({ * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster + * @param {<>} params.waitForNoInitializingShards - Whether to wait until there are no initializing shards in the cluster * @param {<>} params.waitForStatus - Wait until cluster is in a specific state * @param {<>, <>, <>} params.index - Limit the information returned to a specific index */ @@ -1332,6 +1358,10 @@ api.cluster.prototype.health = ca({ type: 'boolean', name: 'wait_for_no_relocating_shards' }, + waitForNoInitializingShards: { + type: 'boolean', + name: 'wait_for_no_initializing_shards' + }, waitForStatus: { type: 'enum', 'default': null, @@ -1359,7 +1389,7 @@ api.cluster.prototype.health = ca({ }); /** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-pending.html) request + * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-pending.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -1381,7 +1411,7 @@ api.cluster.prototype.pendingTasks = ca({ }); /** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-update-settings.html) request + * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1405,11 +1435,23 @@ api.cluster.prototype.putSettings = ca({ url: { fmt: '/_cluster/settings' }, + needBody: true, method: 'PUT' }); /** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-reroute.html) request + * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-remote-info.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.cluster.prototype.remoteInfo = ca({ + url: { + fmt: '/_remote/info' + } +}); + +/** + * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-reroute.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.dryRun - Simulate the operation only and return the resulting state @@ -1459,12 +1501,14 @@ api.cluster.prototype.reroute = ca({ }); /** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-state.html) request + * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-state.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.flatSettings - Return settings in flat format (default: false) + * @param {<>} params.waitForMetadataVersion - Wait for the metadata version to be equal or greater than the specified metadata version + * @param {<>} params.waitForTimeout - The maximum time to wait for wait_for_metadata_version before timing out * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -1484,6 +1528,14 @@ api.cluster.prototype.state = ca({ type: 'boolean', name: 'flat_settings' }, + waitForMetadataVersion: { + type: 'number', + name: 'wait_for_metadata_version' + }, + waitForTimeout: { + type: 'time', + name: 'wait_for_timeout' + }, ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' @@ -1551,7 +1603,7 @@ api.cluster.prototype.state = ca({ }); /** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-stats.html) request + * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1584,21 +1636,23 @@ api.cluster.prototype.stats = ca({ }); /** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-count.html) request + * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-count.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {<>} params.ignoreThrottled - Whether specified concrete, expanded or aliased indices should be ignored when throttled * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value + * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values * @param {<>} params.q - Query in the Lucene query string syntax * @param {<>} params.analyzer - The analyzer to use for the query string * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) * @param {<>} params.df - The field to use as default where no field prefix is given in the query string * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {<>} params.terminateAfter - The maximum count for each shard, upon reaching which the query execution will terminate early * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results */ @@ -1608,6 +1662,10 @@ api.count = ca({ type: 'boolean', name: 'ignore_unavailable' }, + ignoreThrottled: { + type: 'boolean', + name: 'ignore_throttled' + }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -1631,7 +1689,7 @@ api.count = ca({ type: 'string' }, routing: { - type: 'string' + type: 'list' }, q: { type: 'string' @@ -1657,6 +1715,10 @@ api.count = ca({ }, lenient: { type: 'boolean' + }, + terminateAfter: { + type: 'number', + name: 'terminate_after' } }, urls: [ @@ -1687,103 +1749,7 @@ api.count = ca({ }); /** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-index_.html) request + * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -1791,8 +1757,6 @@ api.countPercolate = ca({ * @param {<>} 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 {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with @@ -1824,12 +1788,6 @@ api.create = ca({ timeout: { type: 'time' }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, version: { type: 'number' }, @@ -1847,26 +1805,39 @@ api.create = ca({ type: 'string' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_create/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], needBody: true, method: 'POST' }); /** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-delete.html) request + * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-delete.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -1874,6 +1845,8 @@ api.create = ca({ * @param {<>} 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 {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.ifSeqNo - only perform the delete operation if the last operation that has changed the document has the specified sequence number + * @param {<>} params.ifPrimaryTerm - only perform the delete operation if the last operation that has changed the document has the specified primary term * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - The document ID @@ -1904,6 +1877,14 @@ api['delete'] = ca({ timeout: { type: 'time' }, + ifSeqNo: { + type: 'number', + name: 'if_seq_no' + }, + ifPrimaryTerm: { + type: 'number', + name: 'if_primary_term' + }, version: { type: 'number' }, @@ -1918,25 +1899,38 @@ api['delete'] = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_doc/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], method: 'DELETE' }); /** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-delete-by-query.html) request + * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-delete-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string @@ -1946,7 +1940,7 @@ api['delete'] = ca({ * @param {<>} params.from - Starting offset (default: 0) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? + * @param {<>} [params.conflicts=abort] - What to do when the delete by query hits version conflicts? * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) @@ -1958,8 +1952,8 @@ api['delete'] = ca({ * @param {<>} params.size - Number of hits to return (default: 10) * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes * @param {<>} params.version - Specify whether to return document version as part of a hit @@ -1967,8 +1961,8 @@ api['delete'] = ca({ * @param {<>} params.refresh - Should the effected indexes be refreshed? * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. + * @param {<>} params.scrollSize - Size on the scroll request powering the delete by query + * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete by query is complete. * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -2061,13 +2055,13 @@ api.deleteByQuery = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, terminateAfter: { type: 'number', @@ -2139,46 +2133,51 @@ api.deleteByQuery = ca({ }); /** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html) request + * Perform a [deleteByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-delete-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language + * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * @param {<>} params.taskId - The task id to rethrottle */ -api.deleteScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } +api.deleteByQueryRethrottle = ca({ + params: { + requestsPerSecond: { + type: 'number', + required: true, + name: 'requests_per_second' + } + }, + url: { + fmt: '/_delete_by_query/<%=taskId%>/_rethrottle', + req: { + taskId: { + type: 'string' } } - ], - method: 'DELETE' + }, + method: 'POST' }); /** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request + * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-scripting.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.id - Script ID */ -api.deleteTemplate = ca({ +api.deleteScript = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, url: { - fmt: '/_search/template/<%=id%>', + fmt: '/_scripts/<%=id%>', req: { id: { type: 'string' @@ -2189,7 +2188,7 @@ api.deleteTemplate = ca({ }); /** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html) request + * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -2199,8 +2198,8 @@ api.deleteTemplate = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - The document ID @@ -2231,13 +2230,13 @@ api.exists = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, version: { type: 'number' @@ -2253,25 +2252,38 @@ api.exists = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_doc/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], method: 'HEAD' }); /** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html) request + * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.parent - The ID of the parent document @@ -2280,13 +2292,13 @@ api.exists = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - The document ID * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types + * @param {<>} params.type - The type of the document; deprecated and optional starting with 7.0 */ api.existsSource = ca({ params: { @@ -2308,13 +2320,13 @@ api.existsSource = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, version: { type: 'number' @@ -2330,25 +2342,38 @@ api.existsSource = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_source/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], method: 'HEAD' }); /** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-explain.html) request + * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-explain.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) @@ -2362,8 +2387,8 @@ api.existsSource = ca({ * @param {<>} params.q - Query in the Lucene query string syntax * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.id - The document ID * @param {<>} params.index - The name of the index * @param {<>} params.type - The type of the document @@ -2411,34 +2436,47 @@ api.explain = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_explain/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], method: 'POST' }); /** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-caps.html) request + * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-field-caps.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.fields - A comma-separated list of field names @@ -2489,67 +2527,7 @@ api.fieldCaps = ca({ }); /** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html) request + * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -2559,6 +2537,8 @@ api.fieldStats = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field * @param {<>} params.version - Explicit version number for concurrency control @@ -2591,6 +2571,14 @@ api.get = ca({ _source: { type: 'list' }, + _sourceExcludes: { + type: 'list', + name: '_source_excludes' + }, + _sourceIncludes: { + type: 'list', + name: '_source_includes' + }, _sourceExclude: { type: 'list', name: '_source_exclude' @@ -2613,35 +2601,14 @@ api.get = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ urls: [ { - fmt: '/_scripts/<%=lang%>/<%=id%>', + fmt: '/<%=index%>/<%=type%>/<%=id%>', req: { - lang: { + index: { + type: 'string' + }, + type: { type: 'string' }, id: { @@ -2650,9 +2617,12 @@ api.getScript = ca({ } }, { - fmt: '/_scripts/<%=lang%>', + fmt: '/<%=index%>/_doc/<%=id%>', req: { - lang: { + index: { + type: 'string' + }, + id: { type: 'string' } } @@ -2661,7 +2631,31 @@ api.getScript = ca({ }); /** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html) request + * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.id - Script ID + */ +api.getScript = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_scripts/<%=id%>', + req: { + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.parent - The ID of the parent document @@ -2670,13 +2664,13 @@ api.getScript = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - The document ID * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types + * @param {<>} params.type - The type of the document; deprecated and optional starting with 7.0 */ api.getSource = ca({ params: { @@ -2698,13 +2692,13 @@ api.getSource = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, version: { type: 'number' @@ -2720,41 +2714,37 @@ api.getSource = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_source/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - } + ] }); /** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-index_.html) request + * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -2763,10 +2753,10 @@ api.getTemplate = ca({ * @param {<>} 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 {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type + * @param {<>} params.ifSeqNo - only perform the index operation if the last operation that has changed the document has the specified sequence number + * @param {<>} params.ifPrimaryTerm - only perform the index operation if the last operation that has changed the document has the specified primary term * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with * @param {<>} params.id - Document ID * @param {<>} params.index - The name of the index @@ -2805,12 +2795,6 @@ api.index = ca({ timeout: { type: 'time' }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, version: { type: 'number' }, @@ -2824,6 +2808,14 @@ api.index = ca({ ], name: 'version_type' }, + ifSeqNo: { + type: 'number', + name: 'if_seq_no' + }, + ifPrimaryTerm: { + type: 'number', + name: 'if_primary_term' + }, pipeline: { type: 'string' } @@ -2853,6 +2845,25 @@ api.index = ca({ type: 'string' } } + }, + { + fmt: '/<%=index%>/_doc/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_doc', + req: { + index: { + type: 'string' + } + } } ], needBody: true, @@ -2862,62 +2873,15 @@ api.index = ca({ api.indices = namespace(); /** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-analyze.html) request + * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-analyze.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [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: [ @@ -2937,27 +2901,20 @@ api.indices.prototype.analyze = ca({ }); /** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-clearcache.html) request + * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-clearcache.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) + * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) * @param {<>} params.query - Clear query caches * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.requestCache - Clear request cache * @param {<>} params.request - Clear request cache */ api.indices.prototype.clearCache = ca({ params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, fielddata: { type: 'boolean' }, @@ -2989,13 +2946,6 @@ api.indices.prototype.clearCache = ca({ index: { type: 'list' }, - recycler: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, request: { type: 'boolean' } @@ -3017,7 +2967,7 @@ api.indices.prototype.clearCache = ca({ }); /** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-open-close.html) request + * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -3068,17 +3018,21 @@ api.indices.prototype.close = ca({ }); /** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-create-index.html) request + * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-create-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not * @param {<>} params.index - The name of the index */ api.indices.prototype.create = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, waitForActiveShards: { type: 'string', name: 'wait_for_active_shards' @@ -3089,10 +3043,6 @@ api.indices.prototype.create = ca({ masterTimeout: { type: 'time', name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' } }, url: { @@ -3107,11 +3057,14 @@ api.indices.prototype.create = ca({ }); /** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-delete-index.html) request + * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-delete-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) + * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) + * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices */ api.indices.prototype['delete'] = ca({ @@ -3122,6 +3075,25 @@ api.indices.prototype['delete'] = ca({ 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: { @@ -3136,7 +3108,7 @@ api.indices.prototype['delete'] = ca({ }); /** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request + * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit timestamp for the document @@ -3169,7 +3141,7 @@ api.indices.prototype.deleteAlias = ca({ }); /** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html) request + * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -3198,7 +3170,7 @@ api.indices.prototype.deleteTemplate = ca({ }); /** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-exists.html) request + * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-exists.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -3255,7 +3227,7 @@ api.indices.prototype.exists = ca({ }); /** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request + * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3315,7 +3287,7 @@ api.indices.prototype.existsAlias = ca({ }); /** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html) request + * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -3349,7 +3321,7 @@ api.indices.prototype.existsTemplate = ca({ }); /** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-types-exists.html) request + * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-types-exists.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3399,7 +3371,7 @@ api.indices.prototype.existsType = ca({ }); /** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-flush.html) request + * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-flush.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -3455,7 +3427,7 @@ api.indices.prototype.flush = ca({ }); /** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-synced-flush.html) request + * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-synced-flush.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3502,7 +3474,7 @@ api.indices.prototype.flushSynced = ca({ }); /** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-forcemerge.html) request + * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-forcemerge.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) @@ -3511,8 +3483,6 @@ api.indices.prototype.flushSynced = ca({ * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) * @param {<>, <>, <>} 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({ @@ -3546,13 +3516,6 @@ api.indices.prototype.forcemerge = ca({ onlyExpungeDeletes: { type: 'boolean', name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' } }, urls: [ @@ -3572,20 +3535,25 @@ api.indices.prototype.forcemerge = ca({ }); /** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-index.html) request + * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-get-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether to add the type name to the response (default: false) * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) * @param {<>} params.flatSettings - Return settings in flat format (default: false) * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. + * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features */ api.indices.prototype.get = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, local: { type: 'boolean' }, @@ -3616,38 +3584,24 @@ api.indices.prototype.get = ca({ type: 'boolean', 'default': false, name: 'include_defaults' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' } }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } + url: { + fmt: '/<%=index%>', + req: { + index: { + type: 'list' } } - ] + } }); /** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request + * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3717,9 +3671,10 @@ api.indices.prototype.getAlias = ca({ }); /** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-field-mapping.html) request + * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-get-field-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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) @@ -3731,6 +3686,10 @@ api.indices.prototype.getAlias = ca({ */ api.indices.prototype.getFieldMapping = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, includeDefaults: { type: 'boolean', name: 'include_defaults' @@ -3807,18 +3766,24 @@ api.indices.prototype.getFieldMapping = ca({ }); /** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-mapping.html) request + * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-get-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether to add the type name to the response (default: false) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>, <>, <>} params.index - A comma-separated list of index names * @param {<>, <>, <>} params.type - A comma-separated list of document types */ api.indices.prototype.getMapping = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' @@ -3838,6 +3803,10 @@ api.indices.prototype.getMapping = ca({ ], name: 'expand_wildcards' }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, local: { type: 'boolean' } @@ -3877,9 +3846,10 @@ api.indices.prototype.getMapping = ca({ }); /** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-settings.html) request + * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-get-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -3891,6 +3861,10 @@ api.indices.prototype.getMapping = ca({ */ api.indices.prototype.getSettings = ca({ params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' @@ -3961,9 +3935,10 @@ api.indices.prototype.getSettings = ca({ }); /** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html) request + * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.flatSettings - Return settings in flat format (default: false) * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -3971,6 +3946,10 @@ api.indices.prototype.getSettings = ca({ */ api.indices.prototype.getTemplate = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, flatSettings: { type: 'boolean', name: 'flat_settings' @@ -3999,7 +3978,7 @@ api.indices.prototype.getTemplate = ca({ }); /** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-upgrade.html) request + * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -4045,7 +4024,7 @@ api.indices.prototype.getUpgrade = ca({ }); /** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-open-close.html) request + * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -4053,6 +4032,7 @@ api.indices.prototype.getUpgrade = ca({ * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {<>} params.waitForActiveShards - Sets the number of active shards to wait for before the operation returns. * @param {<>, <>, <>} params.index - A comma separated list of indices to open */ api.indices.prototype.open = ca({ @@ -4082,6 +4062,10 @@ api.indices.prototype.open = ca({ 'all' ], name: 'expand_wildcards' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' } }, url: { @@ -4096,7 +4080,7 @@ api.indices.prototype.open = ca({ }); /** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request + * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit timestamp for the document @@ -4129,20 +4113,24 @@ api.indices.prototype.putAlias = ca({ }); /** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-put-mapping.html) request + * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-put-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not * @param {<>, <>, <>} 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 {<>} params.type - The name of the document type */ api.indices.prototype.putMapping = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, timeout: { type: 'time' }, @@ -4168,10 +4156,6 @@ api.indices.prototype.putMapping = ca({ 'all' ], name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' } }, urls: [ @@ -4193,6 +4177,14 @@ api.indices.prototype.putMapping = ca({ type: 'string' } } + }, + { + fmt: '/<%=index%>/_mapping', + req: { + index: { + type: 'list' + } + } } ], needBody: true, @@ -4200,10 +4192,11 @@ api.indices.prototype.putMapping = ca({ }); /** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-update-settings.html) request + * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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) @@ -4217,6 +4210,9 @@ api.indices.prototype.putSettings = ca({ type: 'time', name: 'master_timeout' }, + timeout: { + type: 'time' + }, preserveExisting: { type: 'boolean', name: 'preserve_existing' @@ -4263,9 +4259,10 @@ api.indices.prototype.putSettings = ca({ }); /** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html) request + * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one * @param {<>} params.timeout - Explicit operation timeout @@ -4275,6 +4272,10 @@ api.indices.prototype.putSettings = ca({ */ api.indices.prototype.putTemplate = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, order: { type: 'number' }, @@ -4307,7 +4308,7 @@ api.indices.prototype.putTemplate = ca({ }); /** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-recovery.html) request + * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-recovery.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.detailed - Whether to display detailed information about shard recovery @@ -4342,7 +4343,7 @@ api.indices.prototype.recovery = ca({ }); /** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-refresh.html) request + * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-refresh.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -4389,9 +4390,10 @@ api.indices.prototype.refresh = ca({ }); /** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-rollover-index.html) request + * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-rollover-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be included in the body of the mappings. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false * @param {<>} params.masterTimeout - Specify timeout for connection to master @@ -4401,6 +4403,10 @@ api.indices.prototype.refresh = ca({ */ api.indices.prototype.rollover = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, timeout: { type: 'time' }, @@ -4442,13 +4448,12 @@ api.indices.prototype.rollover = ca({ }); /** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-segments.html) request + * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-segments.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? * @param {<>} params.verbose - Includes detailed memory usage by Lucene. * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ @@ -4473,9 +4478,6 @@ api.indices.prototype.segments = ca({ ], name: 'expand_wildcards' }, - operationThreading: { - name: 'operation_threading' - }, verbose: { type: 'boolean', 'default': false @@ -4497,14 +4499,13 @@ api.indices.prototype.segments = ca({ }); /** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-shards-stores.html) request + * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-shards-stores.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? * @param {<>, <>, <>} 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({ @@ -4536,9 +4537,6 @@ api.indices.prototype.shardStores = ca({ 'all' ], name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' } }, urls: [ @@ -4557,9 +4555,10 @@ api.indices.prototype.shardStores = ca({ }); /** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-shrink-index.html) request + * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-shrink-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.copySettings - whether or not to copy settings from the source index (defaults to false) * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. @@ -4568,6 +4567,10 @@ api.indices.prototype.shardStores = ca({ */ api.indices.prototype.shrink = ca({ params: { + copySettings: { + type: 'boolean', + name: 'copy_settings' + }, timeout: { type: 'time' }, @@ -4595,7 +4598,50 @@ api.indices.prototype.shrink = ca({ }); /** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-stats.html) request + * Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-split-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.copySettings - whether or not to copy settings from the source index (defaults to false) + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. + * @param {<>} params.index - The name of the source index to split + * @param {<>} params.target - The name of the target index to split into + */ +api.indices.prototype.split = ca({ + params: { + copySettings: { + type: 'boolean', + name: 'copy_settings' + }, + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + } + }, + url: { + fmt: '/<%=index%>/_split/<%=target%>', + req: { + index: { + type: 'string' + }, + target: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) @@ -4661,7 +4707,6 @@ api.indices.prototype.stats = ca({ 'get', 'indexing', 'merge', - 'percolate', 'request_cache', 'refresh', 'search', @@ -4688,7 +4733,6 @@ api.indices.prototype.stats = ca({ 'get', 'indexing', 'merge', - 'percolate', 'request_cache', 'refresh', 'search', @@ -4715,7 +4759,7 @@ api.indices.prototype.stats = ca({ }); /** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request + * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Request timeout @@ -4739,7 +4783,7 @@ api.indices.prototype.updateAliases = ca({ }); /** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-upgrade.html) request + * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -4796,14 +4840,13 @@ api.indices.prototype.upgrade = ca({ }); /** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-validate.html) request + * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-validate.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.explain - Return detailed information about the error * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? * @param {<>} params.q - Query in the Lucene query string syntax * @param {<>} params.analyzer - The analyzer to use for the query string * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) @@ -4839,9 +4882,6 @@ api.indices.prototype.validateQuery = ca({ ], name: 'expand_wildcards' }, - operationThreading: { - name: 'operation_threading' - }, q: { type: 'string' }, @@ -4903,7 +4943,7 @@ api.indices.prototype.validateQuery = ca({ }); /** - * Perform a [info](https://www.elastic.co/guide/) request + * Perform a [info](http://www.elastic.co/guide/) request * * @param {Object} params - An object with parameters used to carry out this action */ @@ -4916,7 +4956,7 @@ api.info = ca({ api.ingest = namespace(); /** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html) request + * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/7.0/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -4945,7 +4985,7 @@ api.ingest.prototype.deletePipeline = ca({ }); /** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html) request + * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/7.0/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -4974,7 +5014,18 @@ api.ingest.prototype.getPipeline = ca({ }); /** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html) request + * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/7.0/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.ingest.prototype.processorGrok = ca({ + url: { + fmt: '/_ingest/processor/grok' + } +}); + +/** + * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/7.0/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -5004,7 +5055,7 @@ api.ingest.prototype.putPipeline = ca({ }); /** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html) request + * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/7.0/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline @@ -5035,7 +5086,7 @@ api.ingest.prototype.simulate = ca({ }); /** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-multi-get.html) request + * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-multi-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -5044,8 +5095,8 @@ api.ingest.prototype.simulate = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.index - The name of the index * @param {<>} params.type - The type of the document */ @@ -5070,13 +5121,13 @@ api.mget = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' } }, urls: [ @@ -5108,73 +5159,16 @@ api.mget = ca({ }); /** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-multi-search.html) request + * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.searchType - Search operation type * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default */ @@ -5197,6 +5191,26 @@ api.msearch = ca({ typedKeys: { type: 'boolean', name: 'typed_keys' + }, + preFilterShardSize: { + type: 'number', + 'default': 128, + name: 'pre_filter_shard_size' + }, + maxConcurrentShardRequests: { + type: 'number', + 'default': 'The default grows with the number of nodes in the cluster but is at most 256.', + name: 'max_concurrent_shard_requests' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -5229,12 +5243,14 @@ api.msearch = ca({ }); /** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request + * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.searchType - Search operation type * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default */ @@ -5257,6 +5273,16 @@ api.msearchTemplate = ca({ maxConcurrentSearches: { type: 'number', name: 'max_concurrent_searches' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -5289,7 +5315,7 @@ api.msearchTemplate = ca({ }); /** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-multi-termvectors.html) request + * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-multi-termvectors.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body @@ -5405,7 +5431,7 @@ api.mtermvectors = ca({ api.nodes = namespace(); /** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-hot-threads.html) request + * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-nodes-hot-threads.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.interval - The interval for the second sampling of threads @@ -5459,7 +5485,7 @@ api.nodes.prototype.hotThreads = ca({ }); /** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-info.html) request + * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-nodes-info.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -5534,7 +5560,36 @@ api.nodes.prototype.info = ca({ }); /** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-stats.html) request + * Perform a [nodes.reloadSecureSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/secure-settings.html#reloadable-secure-settings) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. + */ +api.nodes.prototype.reloadSecureSettings = ca({ + params: { + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/reload_secure_settings', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/reload_secure_settings' + } + ], + method: 'POST' +}); + +/** + * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-nodes-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) @@ -5621,7 +5676,6 @@ api.nodes.prototype.stats = ca({ 'get', 'indexing', 'merge', - 'percolate', 'request_cache', 'refresh', 'search', @@ -5688,7 +5742,6 @@ api.nodes.prototype.stats = ca({ 'get', 'indexing', 'merge', - 'percolate', 'request_cache', 'refresh', 'search', @@ -5736,33 +5789,131 @@ api.nodes.prototype.stats = ca({ }); /** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html) request + * Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cluster-nodes-usage.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics + * @param {<>, <>, <>} 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.usage = ca({ + params: { + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/usage/<%=metric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'rest_actions' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>/usage', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/usage/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'rest_actions' + ] + } + } + }, + { + fmt: '/_nodes/usage' + } + ] +}); + +/** + * 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: '/' + }, + method: 'HEAD' +}); + +/** + * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.context - Script context + * @param {<>} params.id - Script ID + */ +api.putScript = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + context: { + type: 'string' + } + }, + urls: [ + { + fmt: '/_scripts/<%=id%>/<%=context%>', + req: { + id: { + type: 'string' + }, + context: { + type: 'string' + } + } + }, + { + fmt: '/_scripts/<%=id%>', + req: { + id: { + type: 'string' + } + } + } + ], + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [rankEval](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-rank-eval.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} 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. + * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices */ -api.percolate = ca({ +api.rankEval = ca({ params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' @@ -5781,140 +5932,27 @@ api.percolate = ca({ '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', + fmt: '/<%=index%>/_rank_eval', req: { index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + type: 'list' } } }, { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } + fmt: '/_rank_eval' } ], + needBody: true, method: 'POST' }); /** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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/5.5/docs-reindex.html) request + * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-reindex.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.refresh - Should the effected indexes be refreshed? @@ -5960,7 +5998,7 @@ api.reindex = ca({ }); /** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-reindex.html) request + * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-reindex.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. @@ -5985,21 +6023,8 @@ api.reindexRethrottle = ca({ method: 'POST' }); -api.remote = namespace(); - /** - * Perform a [remote.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.remote.prototype.info = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request + * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-template.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.id - The id of the stored search template @@ -6022,11 +6047,24 @@ api.renderSearchTemplate = ca({ }); /** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-request-scroll.html) request + * Perform a [scriptsPainlessExecute](https://www.elastic.co/guide/en/elasticsearch/painless/7.0/painless-execute-api.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.scriptsPainlessExecute = ca({ + url: { + fmt: '/_scripts/painless/_execute' + }, + method: 'POST' +}); + +/** + * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {<>} params.scrollId - The scroll ID + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response */ api.scroll = ca({ params: { @@ -6036,6 +6074,11 @@ api.scroll = ca({ scrollId: { type: 'string', name: 'scroll_id' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' } }, urls: [ @@ -6059,19 +6102,20 @@ api.scroll = ca({ }); /** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-search.html) request + * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) * @param {<>} params.df - The field to use as default where no field prefix is given in the query string * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit * @param {<>} params.from - Starting offset (default: 0) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {<>} params.ignoreThrottled - Whether specified concrete, expanded or aliased indices should be ignored when throttled * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored @@ -6083,8 +6127,8 @@ api.scroll = ca({ * @param {<>} params.size - Number of hits to return (default: 10) * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes * @param {<>} params.suggestField - Specify which field to use for suggestions @@ -6093,10 +6137,16 @@ api.scroll = ca({ * @param {<>} params.suggestText - The source text for which the suggestions should be returned * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting + * @param {<>} params.trackTotalHits - Indicate if the number of documents that match the query should be tracked + * @param {<>} [params.allowPartialSearchResults=true] - Indicate if an error should be returned if there is a partial search failure or timeout * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response * @param {<>} params.version - Specify whether to return document version as part of a hit + * @param {<>} params.seqNoPrimaryTerm - Specify whether to return sequence number and primary term of the last modification of each hit * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. + * @param {<>} [params.maxConcurrentShardRequests=The default is 5.] - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -6109,6 +6159,11 @@ api.search = ca({ type: 'boolean', name: 'analyze_wildcard' }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' + }, defaultOperator: { type: 'enum', 'default': 'OR', @@ -6132,10 +6187,6 @@ api.search = ca({ type: 'list', name: 'docvalue_fields' }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, from: { type: 'number' }, @@ -6143,6 +6194,10 @@ api.search = ca({ type: 'boolean', name: 'ignore_unavailable' }, + ignoreThrottled: { + type: 'boolean', + name: 'ignore_throttled' + }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -6190,13 +6245,13 @@ api.search = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, terminateAfter: { type: 'number', @@ -6234,6 +6289,15 @@ api.search = ca({ type: 'boolean', name: 'track_scores' }, + trackTotalHits: { + type: 'boolean', + name: 'track_total_hits' + }, + allowPartialSearchResults: { + type: 'boolean', + 'default': true, + name: 'allow_partial_search_results' + }, typedKeys: { type: 'boolean', name: 'typed_keys' @@ -6241,6 +6305,10 @@ api.search = ca({ version: { type: 'boolean' }, + seqNoPrimaryTerm: { + type: 'boolean', + name: 'seq_no_primary_term' + }, requestCache: { type: 'boolean', name: 'request_cache' @@ -6249,6 +6317,21 @@ api.search = ca({ type: 'number', 'default': 512, name: 'batched_reduce_size' + }, + maxConcurrentShardRequests: { + type: 'number', + 'default': 'The default is 5.', + name: 'max_concurrent_shard_requests' + }, + preFilterShardSize: { + type: 'number', + 'default': 128, + name: 'pre_filter_shard_size' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' } }, urls: [ @@ -6279,7 +6362,7 @@ api.search = ca({ }); /** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-shards.html) request + * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-shards.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) @@ -6289,7 +6372,6 @@ api.search = ca({ * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ api.searchShards = ca({ params: { @@ -6323,17 +6405,6 @@ api.searchShards = ca({ } }, urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, { fmt: '/<%=index%>/_search_shards', req: { @@ -6350,10 +6421,11 @@ api.searchShards = ca({ }); /** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request + * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-template.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {<>} params.ignoreThrottled - Whether specified concrete, expanded or aliased indices should be ignored when throttled * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) @@ -6363,6 +6435,8 @@ api.searchShards = ca({ * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit * @param {<>} params.profile - Specify whether to profile the query execution * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -6372,6 +6446,10 @@ api.searchTemplate = ca({ type: 'boolean', name: 'ignore_unavailable' }, + ignoreThrottled: { + type: 'boolean', + name: 'ignore_throttled' + }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -6415,6 +6493,16 @@ api.searchTemplate = ca({ typedKeys: { type: 'boolean', name: 'typed_keys' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -6441,13 +6529,14 @@ api.searchTemplate = ca({ fmt: '/_search/template' } ], + needBody: true, method: 'POST' }); api.snapshot = namespace(); /** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6482,7 +6571,7 @@ api.snapshot.prototype.create = ca({ }); /** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6516,7 +6605,7 @@ api.snapshot.prototype.createRepository = ca({ }); /** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6545,7 +6634,7 @@ api.snapshot.prototype['delete'] = ca({ }); /** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6574,7 +6663,7 @@ api.snapshot.prototype.deleteRepository = ca({ }); /** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6611,7 +6700,7 @@ api.snapshot.prototype.get = ca({ }); /** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6644,7 +6733,7 @@ api.snapshot.prototype.getRepository = ca({ }); /** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6679,7 +6768,7 @@ api.snapshot.prototype.restore = ca({ }); /** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6725,7 +6814,7 @@ api.snapshot.prototype.status = ca({ }); /** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request + * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6753,90 +6842,28 @@ api.snapshot.prototype.verifyRepository = ca({ method: 'POST' }); -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html) request + * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.nodes - 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. + * @param {<>} params.parentTaskId - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. * @param {<>} 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' + nodes: { + type: 'list' }, actions: { type: 'list' }, - parentNode: { + parentTaskId: { type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' + name: 'parent_task_id' } }, urls: [ @@ -6856,10 +6883,11 @@ api.tasks.prototype.cancel = ca({ }); /** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html) request + * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) + * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) */ api.tasks.prototype.get = ca({ @@ -6867,6 +6895,9 @@ api.tasks.prototype.get = ca({ waitForCompletion: { type: 'boolean', name: 'wait_for_completion' + }, + timeout: { + type: 'time' } }, url: { @@ -6880,22 +6911,21 @@ api.tasks.prototype.get = ca({ }); /** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html) request + * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.nodes - 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + * @param {<>} params.parentTaskId - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships + * @param {<>} params.timeout - Explicit operation timeout */ api.tasks.prototype.list = ca({ params: { - nodeId: { - type: 'list', - name: 'node_id' + nodes: { + type: 'list' }, actions: { type: 'list' @@ -6903,13 +6933,9 @@ api.tasks.prototype.list = ca({ detailed: { type: 'boolean' }, - parentNode: { + parentTaskId: { type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' + name: 'parent_task_id' }, waitForCompletion: { type: 'boolean', @@ -6920,9 +6946,13 @@ api.tasks.prototype.list = ca({ 'default': 'nodes', options: [ 'nodes', - 'parents' + 'parents', + 'none' ], name: 'group_by' + }, + timeout: { + type: 'time' } }, url: { @@ -6931,7 +6961,7 @@ api.tasks.prototype.list = ca({ }); /** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-termvectors.html) request + * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-termvectors.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. @@ -7028,6 +7058,17 @@ api.termvectors = ca({ } } }, + { + fmt: '/<%=index%>/_termvectors/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, { fmt: '/<%=index%>/<%=type%>/_termvectors', req: { @@ -7038,30 +7079,35 @@ api.termvectors = ca({ type: 'string' } } + }, + { + fmt: '/<%=index%>/_termvectors/', + req: { + index: { + type: 'string' + } + } } ], method: 'POST' }); /** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-update.html) request + * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-update.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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 {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.lang - The script language (default: painless) * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request * @param {<>} 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 {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) * @param {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type + * @param {<>} params.ifSeqNo - only perform the update operation if the last operation that has changed the document has the specified sequence number + * @param {<>} params.ifPrimaryTerm - only perform the update operation if the last operation that has changed the document has the specified primary term * @param {<>} params.id - Document ID * @param {<>} params.index - The name of the index * @param {<>} params.type - The type of the document @@ -7072,19 +7118,16 @@ api.update = ca({ type: 'string', name: 'wait_for_active_shards' }, - fields: { - type: 'list' - }, _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, lang: { type: 'string' @@ -7111,43 +7154,48 @@ api.update = ca({ timeout: { type: 'time' }, - timestamp: { - type: 'time' + ifSeqNo: { + type: 'number', + name: 'if_seq_no' }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' + ifPrimaryTerm: { + type: 'number', + name: 'if_primary_term' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_update/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], + needBody: true, method: 'POST' }); /** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-update-by-query.html) request + * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-update-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string @@ -7170,8 +7218,8 @@ api.update = ca({ * @param {<>} params.size - Number of hits to return (default: 10) * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes * @param {<>} params.version - Specify whether to return document version as part of a hit @@ -7180,7 +7228,7 @@ api.update = ca({ * @param {<>} params.refresh - Should the effected indexes be refreshed? * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {<>} params.scrollSize - Size on the scroll request powering the update by query * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. @@ -7277,13 +7325,13 @@ api.updateByQuery = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, terminateAfter: { type: 'number', @@ -7356,3 +7404,29 @@ api.updateByQuery = ca({ ], method: 'POST' }); + +/** + * Perform a [updateByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-update-by-query.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * @param {<>} params.taskId - The task id to rethrottle + */ +api.updateByQueryRethrottle = ca({ + params: { + requestsPerSecond: { + type: 'number', + required: true, + name: 'requests_per_second' + } + }, + url: { + fmt: '/_update_by_query/<%=taskId%>/_rethrottle', + req: { + taskId: { + type: 'string' + } + } + }, + method: 'POST' +}); diff --git a/src/lib/apis/5_4.js b/src/lib/apis/7_x.js similarity index 87% rename from src/lib/apis/5_4.js rename to src/lib/apis/7_x.js index 9e84e3217..931b21689 100644 --- a/src/lib/apis/5_4.js +++ b/src/lib/apis/7_x.js @@ -11,10 +11,10 @@ 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', 'remote', 'snapshot', 'tasks']; +api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; /** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-bulk.html) request + * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-bulk.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -22,10 +22,9 @@ api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'remote', 'sn * @param {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request * @param {<>, <>, <>} 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 {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request + * @param {<>, <>, <>} params._sourceExcludes - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request + * @param {<>, <>, <>} params._sourceIncludes - Default list of fields to extract and return from the _source field, can be overridden on each sub-request * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with * @param {<>} params.index - Default index for items which don't provide one */ @@ -53,19 +52,16 @@ api.bulk = ca({ type: { type: 'string' }, - fields: { - type: 'list' - }, _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, pipeline: { type: 'string' @@ -103,7 +99,7 @@ api.bulk = ca({ api.cat = namespace(); /** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat.html) request + * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -158,7 +154,7 @@ api.cat.prototype.aliases = ca({ }); /** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-allocation.html) request + * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-allocation.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -230,7 +226,7 @@ api.cat.prototype.allocation = ca({ }); /** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-count.html) request + * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-count.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -285,7 +281,7 @@ api.cat.prototype.count = ca({ }); /** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-fielddata.html) request + * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-fielddata.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -360,7 +356,7 @@ api.cat.prototype.fielddata = ca({ }); /** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-health.html) request + * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-health.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -409,7 +405,7 @@ api.cat.prototype.health = ca({ }); /** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat.html) request + * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.help - Return help information @@ -431,7 +427,7 @@ api.cat.prototype.help = ca({ }); /** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-indices.html) request + * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-indices.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -511,7 +507,7 @@ api.cat.prototype.indices = ca({ }); /** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-master.html) request + * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-master.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -555,7 +551,7 @@ api.cat.prototype.master = ca({ }); /** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-nodeattrs.html) request + * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-nodeattrs.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -599,7 +595,7 @@ api.cat.prototype.nodeattrs = ca({ }); /** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-nodes.html) request + * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-nodes.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -648,7 +644,7 @@ api.cat.prototype.nodes = ca({ }); /** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-pending-tasks.html) request + * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-pending-tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -692,7 +688,7 @@ api.cat.prototype.pendingTasks = ca({ }); /** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-plugins.html) request + * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-plugins.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -736,7 +732,7 @@ api.cat.prototype.plugins = ca({ }); /** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-recovery.html) request + * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-recovery.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -804,7 +800,7 @@ api.cat.prototype.recovery = ca({ }); /** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-repositories.html) request + * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-repositories.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -849,10 +845,11 @@ api.cat.prototype.repositories = ca({ }); /** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-segments.html) request + * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-segments.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml + * @param {<>} params.bytes - The unit in which to display byte values * @param {<>, <>, <>} params.h - Comma-separated list of column names to display * @param {<>} params.help - Return help information * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by @@ -864,6 +861,22 @@ api.cat.prototype.segments = ca({ format: { type: 'string' }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, h: { type: 'list' }, @@ -895,10 +908,11 @@ api.cat.prototype.segments = ca({ }); /** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-shards.html) request + * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-shards.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml + * @param {<>} params.bytes - The unit in which to display byte values * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node * @param {<>, <>, <>} params.h - Comma-separated list of column names to display @@ -912,6 +926,22 @@ api.cat.prototype.shards = ca({ format: { type: 'string' }, + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'kb', + 'm', + 'mb', + 'g', + 'gb', + 't', + 'tb', + 'p', + 'pb' + ] + }, local: { type: 'boolean' }, @@ -950,7 +980,7 @@ api.cat.prototype.shards = ca({ }); /** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-snapshots.html) request + * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1007,14 +1037,13 @@ api.cat.prototype.snapshots = ca({ }); /** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html) request + * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml * @param {<>, <>, <>} 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. * @param {<>, <>, <>} params.h - Comma-separated list of column names to display * @param {<>} params.help - Return help information @@ -1036,10 +1065,6 @@ api.cat.prototype.tasks = ca({ detailed: { type: 'boolean' }, - parentNode: { - type: 'string', - name: 'parent_node' - }, parentTask: { type: 'number', name: 'parent_task' @@ -1065,7 +1090,7 @@ api.cat.prototype.tasks = ca({ }); /** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-templates.html) request + * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1120,7 +1145,7 @@ api.cat.prototype.templates = ca({ }); /** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-thread-pool.html) request + * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-thread-pool.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml @@ -1187,7 +1212,7 @@ api.cat.prototype.threadPool = ca({ }); /** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-scroll.html) request + * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear @@ -1208,8 +1233,7 @@ api.clearScroll = ca({ ], paramAsBody: { param: 'scrollId', - body: 'scroll_id', - castToArray: true + body: 'scroll_id' }, method: 'DELETE' }); @@ -1217,7 +1241,7 @@ api.clearScroll = ca({ api.cluster = namespace(); /** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-allocation-explain.html) request + * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-allocation-explain.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) @@ -1241,7 +1265,7 @@ api.cluster.prototype.allocationExplain = ca({ }); /** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-update-settings.html) request + * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1274,7 +1298,7 @@ api.cluster.prototype.getSettings = ca({ }); /** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-health.html) request + * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-health.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} [params.level=cluster] - Specify the level of detail for returned information @@ -1285,6 +1309,7 @@ api.cluster.prototype.getSettings = ca({ * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster + * @param {<>} params.waitForNoInitializingShards - Whether to wait until there are no initializing shards in the cluster * @param {<>} params.waitForStatus - Wait until cluster is in a specific state * @param {<>, <>, <>} params.index - Limit the information returned to a specific index */ @@ -1333,6 +1358,10 @@ api.cluster.prototype.health = ca({ type: 'boolean', name: 'wait_for_no_relocating_shards' }, + waitForNoInitializingShards: { + type: 'boolean', + name: 'wait_for_no_initializing_shards' + }, waitForStatus: { type: 'enum', 'default': null, @@ -1360,7 +1389,7 @@ api.cluster.prototype.health = ca({ }); /** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-pending.html) request + * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-pending.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -1382,7 +1411,7 @@ api.cluster.prototype.pendingTasks = ca({ }); /** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-update-settings.html) request + * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1406,11 +1435,23 @@ api.cluster.prototype.putSettings = ca({ url: { fmt: '/_cluster/settings' }, + needBody: true, method: 'PUT' }); /** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-reroute.html) request + * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-remote-info.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.cluster.prototype.remoteInfo = ca({ + url: { + fmt: '/_remote/info' + } +}); + +/** + * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-reroute.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.dryRun - Simulate the operation only and return the resulting state @@ -1460,12 +1501,14 @@ api.cluster.prototype.reroute = ca({ }); /** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-state.html) request + * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-state.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.flatSettings - Return settings in flat format (default: false) + * @param {<>} params.waitForMetadataVersion - Wait for the metadata version to be equal or greater than the specified metadata version + * @param {<>} params.waitForTimeout - The maximum time to wait for wait_for_metadata_version before timing out * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -1485,6 +1528,14 @@ api.cluster.prototype.state = ca({ type: 'boolean', name: 'flat_settings' }, + waitForMetadataVersion: { + type: 'number', + name: 'wait_for_metadata_version' + }, + waitForTimeout: { + type: 'time', + name: 'wait_for_timeout' + }, ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' @@ -1552,7 +1603,7 @@ api.cluster.prototype.state = ca({ }); /** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-stats.html) request + * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -1585,21 +1636,23 @@ api.cluster.prototype.stats = ca({ }); /** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-count.html) request + * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-count.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {<>} params.ignoreThrottled - Whether specified concrete, expanded or aliased indices should be ignored when throttled * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value + * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values * @param {<>} params.q - Query in the Lucene query string syntax * @param {<>} params.analyzer - The analyzer to use for the query string * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) * @param {<>} params.df - The field to use as default where no field prefix is given in the query string * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {<>} params.terminateAfter - The maximum count for each shard, upon reaching which the query execution will terminate early * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results */ @@ -1609,6 +1662,10 @@ api.count = ca({ type: 'boolean', name: 'ignore_unavailable' }, + ignoreThrottled: { + type: 'boolean', + name: 'ignore_throttled' + }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -1632,7 +1689,7 @@ api.count = ca({ type: 'string' }, routing: { - type: 'string' + type: 'list' }, q: { type: 'string' @@ -1658,6 +1715,10 @@ api.count = ca({ }, lenient: { type: 'boolean' + }, + terminateAfter: { + type: 'number', + name: 'terminate_after' } }, urls: [ @@ -1688,103 +1749,7 @@ api.count = ca({ }); /** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html) request + * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -1792,8 +1757,6 @@ api.countPercolate = ca({ * @param {<>} 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 {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with @@ -1825,12 +1788,6 @@ api.create = ca({ timeout: { type: 'time' }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, version: { type: 'number' }, @@ -1848,26 +1805,39 @@ api.create = ca({ type: 'string' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_create/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], needBody: true, method: 'POST' }); /** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete.html) request + * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -1875,6 +1845,8 @@ api.create = ca({ * @param {<>} 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 {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.ifSeqNo - only perform the delete operation if the last operation that has changed the document has the specified sequence number + * @param {<>} params.ifPrimaryTerm - only perform the delete operation if the last operation that has changed the document has the specified primary term * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - The document ID @@ -1905,6 +1877,14 @@ api['delete'] = ca({ timeout: { type: 'time' }, + ifSeqNo: { + type: 'number', + name: 'if_seq_no' + }, + ifPrimaryTerm: { + type: 'number', + name: 'if_primary_term' + }, version: { type: 'number' }, @@ -1919,25 +1899,38 @@ api['delete'] = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_doc/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], method: 'DELETE' }); /** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete-by-query.html) request + * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string @@ -1947,7 +1940,7 @@ api['delete'] = ca({ * @param {<>} params.from - Starting offset (default: 0) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? + * @param {<>} [params.conflicts=abort] - What to do when the delete by query hits version conflicts? * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) @@ -1959,8 +1952,8 @@ api['delete'] = ca({ * @param {<>} params.size - Number of hits to return (default: 10) * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes * @param {<>} params.version - Specify whether to return document version as part of a hit @@ -1968,8 +1961,8 @@ api['delete'] = ca({ * @param {<>} params.refresh - Should the effected indexes be refreshed? * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. + * @param {<>} params.scrollSize - Size on the scroll request powering the delete by query + * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete by query is complete. * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -2062,13 +2055,13 @@ api.deleteByQuery = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, terminateAfter: { type: 'number', @@ -2140,46 +2133,51 @@ api.deleteByQuery = ca({ }); /** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html) request + * Perform a [deleteByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language + * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * @param {<>} params.taskId - The task id to rethrottle */ -api.deleteScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } +api.deleteByQueryRethrottle = ca({ + params: { + requestsPerSecond: { + type: 'number', + required: true, + name: 'requests_per_second' + } + }, + url: { + fmt: '/_delete_by_query/<%=taskId%>/_rethrottle', + req: { + taskId: { + type: 'string' } } - ], - method: 'DELETE' + }, + method: 'POST' }); /** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request + * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.id - Script ID */ -api.deleteTemplate = ca({ +api.deleteScript = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, url: { - fmt: '/_search/template/<%=id%>', + fmt: '/_scripts/<%=id%>', req: { id: { type: 'string' @@ -2190,7 +2188,7 @@ api.deleteTemplate = ca({ }); /** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html) request + * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -2200,8 +2198,8 @@ api.deleteTemplate = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - The document ID @@ -2232,13 +2230,13 @@ api.exists = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, version: { type: 'number' @@ -2254,25 +2252,38 @@ api.exists = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_doc/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], method: 'HEAD' }); /** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html) request + * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.parent - The ID of the parent document @@ -2281,13 +2292,13 @@ api.exists = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - The document ID * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types + * @param {<>} params.type - The type of the document; deprecated and optional starting with 7.0 */ api.existsSource = ca({ params: { @@ -2309,13 +2320,13 @@ api.existsSource = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, version: { type: 'number' @@ -2331,25 +2342,38 @@ api.existsSource = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_source/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], method: 'HEAD' }); /** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-explain.html) request + * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-explain.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) @@ -2363,8 +2387,8 @@ api.existsSource = ca({ * @param {<>} params.q - Query in the Lucene query string syntax * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.id - The document ID * @param {<>} params.index - The name of the index * @param {<>} params.type - The type of the document @@ -2412,34 +2436,47 @@ api.explain = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_explain/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], method: 'POST' }); /** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-field-caps.html) request + * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-field-caps.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.fields - A comma-separated list of field names @@ -2490,67 +2527,7 @@ api.fieldCaps = ca({ }); /** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html) request + * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -2560,6 +2537,8 @@ api.fieldStats = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field * @param {<>} params.version - Explicit version number for concurrency control @@ -2592,6 +2571,14 @@ api.get = ca({ _source: { type: 'list' }, + _sourceExcludes: { + type: 'list', + name: '_source_excludes' + }, + _sourceIncludes: { + type: 'list', + name: '_source_includes' + }, _sourceExclude: { type: 'list', name: '_source_exclude' @@ -2614,35 +2601,14 @@ api.get = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ urls: [ { - fmt: '/_scripts/<%=lang%>/<%=id%>', + fmt: '/<%=index%>/<%=type%>/<%=id%>', req: { - lang: { + index: { + type: 'string' + }, + type: { type: 'string' }, id: { @@ -2651,9 +2617,12 @@ api.getScript = ca({ } }, { - fmt: '/_scripts/<%=lang%>', + fmt: '/<%=index%>/_doc/<%=id%>', req: { - lang: { + index: { + type: 'string' + }, + id: { type: 'string' } } @@ -2662,7 +2631,31 @@ api.getScript = ca({ }); /** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html) request + * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.id - Script ID + */ +api.getScript = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_scripts/<%=id%>', + req: { + id: { + type: 'string' + } + } + } +}); + +/** + * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.parent - The ID of the parent document @@ -2671,13 +2664,13 @@ api.getScript = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type * @param {<>} params.id - The document ID * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types + * @param {<>} params.type - The type of the document; deprecated and optional starting with 7.0 */ api.getSource = ca({ params: { @@ -2699,13 +2692,13 @@ api.getSource = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, version: { type: 'number' @@ -2721,41 +2714,37 @@ api.getSource = ca({ name: 'version_type' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_source/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - } + ] }); /** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html) request + * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -2764,10 +2753,10 @@ api.getTemplate = ca({ * @param {<>} 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 {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document * @param {<>} params.version - Explicit version number for concurrency control * @param {<>} params.versionType - Specific version type + * @param {<>} params.ifSeqNo - only perform the index operation if the last operation that has changed the document has the specified sequence number + * @param {<>} params.ifPrimaryTerm - only perform the index operation if the last operation that has changed the document has the specified primary term * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with * @param {<>} params.id - Document ID * @param {<>} params.index - The name of the index @@ -2806,12 +2795,6 @@ api.index = ca({ timeout: { type: 'time' }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, version: { type: 'number' }, @@ -2825,6 +2808,14 @@ api.index = ca({ ], name: 'version_type' }, + ifSeqNo: { + type: 'number', + name: 'if_seq_no' + }, + ifPrimaryTerm: { + type: 'number', + name: 'if_primary_term' + }, pipeline: { type: 'string' } @@ -2854,6 +2845,25 @@ api.index = ca({ type: 'string' } } + }, + { + fmt: '/<%=index%>/_doc/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_doc', + req: { + index: { + type: 'string' + } + } } ], needBody: true, @@ -2863,62 +2873,15 @@ api.index = ca({ api.indices = namespace(); /** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-analyze.html) request + * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-analyze.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [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: [ @@ -2938,27 +2901,20 @@ api.indices.prototype.analyze = ca({ }); /** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-clearcache.html) request + * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-clearcache.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) + * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) * @param {<>} params.query - Clear query caches * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.requestCache - Clear request cache * @param {<>} params.request - Clear request cache */ api.indices.prototype.clearCache = ca({ params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, fielddata: { type: 'boolean' }, @@ -2990,13 +2946,6 @@ api.indices.prototype.clearCache = ca({ index: { type: 'list' }, - recycler: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, request: { type: 'boolean' } @@ -3018,7 +2967,7 @@ api.indices.prototype.clearCache = ca({ }); /** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-open-close.html) request + * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -3069,17 +3018,21 @@ api.indices.prototype.close = ca({ }); /** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-create-index.html) request + * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-create-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not * @param {<>} params.index - The name of the index */ api.indices.prototype.create = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, waitForActiveShards: { type: 'string', name: 'wait_for_active_shards' @@ -3090,10 +3043,6 @@ api.indices.prototype.create = ca({ masterTimeout: { type: 'time', name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' } }, url: { @@ -3108,11 +3057,14 @@ api.indices.prototype.create = ca({ }); /** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-delete-index.html) request + * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-delete-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) + * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) + * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices */ api.indices.prototype['delete'] = ca({ @@ -3123,6 +3075,25 @@ api.indices.prototype['delete'] = ca({ 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: { @@ -3137,7 +3108,7 @@ api.indices.prototype['delete'] = ca({ }); /** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request + * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit timestamp for the document @@ -3170,7 +3141,7 @@ api.indices.prototype.deleteAlias = ca({ }); /** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html) request + * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -3199,7 +3170,7 @@ api.indices.prototype.deleteTemplate = ca({ }); /** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-exists.html) request + * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-exists.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -3256,7 +3227,7 @@ api.indices.prototype.exists = ca({ }); /** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request + * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3316,7 +3287,7 @@ api.indices.prototype.existsAlias = ca({ }); /** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html) request + * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -3350,7 +3321,7 @@ api.indices.prototype.existsTemplate = ca({ }); /** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-types-exists.html) request + * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-types-exists.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3400,7 +3371,7 @@ api.indices.prototype.existsType = ca({ }); /** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-flush.html) request + * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-flush.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -3456,7 +3427,7 @@ api.indices.prototype.flush = ca({ }); /** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-synced-flush.html) request + * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-synced-flush.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3503,7 +3474,7 @@ api.indices.prototype.flushSynced = ca({ }); /** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-forcemerge.html) request + * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-forcemerge.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) @@ -3512,8 +3483,6 @@ api.indices.prototype.flushSynced = ca({ * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) * @param {<>, <>, <>} 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({ @@ -3547,13 +3516,6 @@ api.indices.prototype.forcemerge = ca({ onlyExpungeDeletes: { type: 'boolean', name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' } }, urls: [ @@ -3573,20 +3535,25 @@ api.indices.prototype.forcemerge = ca({ }); /** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-index.html) request + * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether to add the type name to the response (default: false) * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) * @param {<>} params.flatSettings - Return settings in flat format (default: false) * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. + * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features */ api.indices.prototype.get = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, local: { type: 'boolean' }, @@ -3617,38 +3584,24 @@ api.indices.prototype.get = ca({ type: 'boolean', 'default': false, name: 'include_defaults' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' } }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } + url: { + fmt: '/<%=index%>', + req: { + index: { + type: 'list' } } - ] + } }); /** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request + * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3718,9 +3671,10 @@ api.indices.prototype.getAlias = ca({ }); /** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-field-mapping.html) request + * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-field-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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) @@ -3732,6 +3686,10 @@ api.indices.prototype.getAlias = ca({ */ api.indices.prototype.getFieldMapping = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, includeDefaults: { type: 'boolean', name: 'include_defaults' @@ -3808,18 +3766,24 @@ api.indices.prototype.getFieldMapping = ca({ }); /** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-mapping.html) request + * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether to add the type name to the response (default: false) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {<>, <>, <>} params.index - A comma-separated list of index names * @param {<>, <>, <>} params.type - A comma-separated list of document types */ api.indices.prototype.getMapping = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' @@ -3839,6 +3803,10 @@ api.indices.prototype.getMapping = ca({ ], name: 'expand_wildcards' }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, local: { type: 'boolean' } @@ -3878,9 +3846,10 @@ api.indices.prototype.getMapping = ca({ }); /** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-settings.html) request + * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -3892,6 +3861,10 @@ api.indices.prototype.getMapping = ca({ */ api.indices.prototype.getSettings = ca({ params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' @@ -3962,9 +3935,10 @@ api.indices.prototype.getSettings = ca({ }); /** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html) request + * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.flatSettings - Return settings in flat format (default: false) * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -3972,6 +3946,10 @@ api.indices.prototype.getSettings = ca({ */ api.indices.prototype.getTemplate = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, flatSettings: { type: 'boolean', name: 'flat_settings' @@ -4000,7 +3978,7 @@ api.indices.prototype.getTemplate = ca({ }); /** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-upgrade.html) request + * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -4046,7 +4024,7 @@ api.indices.prototype.getUpgrade = ca({ }); /** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-open-close.html) request + * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit operation timeout @@ -4054,6 +4032,7 @@ api.indices.prototype.getUpgrade = ca({ * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {<>} params.waitForActiveShards - Sets the number of active shards to wait for before the operation returns. * @param {<>, <>, <>} params.index - A comma separated list of indices to open */ api.indices.prototype.open = ca({ @@ -4083,6 +4062,10 @@ api.indices.prototype.open = ca({ 'all' ], name: 'expand_wildcards' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' } }, url: { @@ -4097,7 +4080,7 @@ api.indices.prototype.open = ca({ }); /** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request + * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Explicit timestamp for the document @@ -4130,20 +4113,24 @@ api.indices.prototype.putAlias = ca({ }); /** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-put-mapping.html) request + * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-put-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not * @param {<>, <>, <>} 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 {<>} params.type - The name of the document type */ api.indices.prototype.putMapping = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, timeout: { type: 'time' }, @@ -4169,10 +4156,6 @@ api.indices.prototype.putMapping = ca({ 'all' ], name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' } }, urls: [ @@ -4194,6 +4177,14 @@ api.indices.prototype.putMapping = ca({ type: 'string' } } + }, + { + fmt: '/<%=index%>/_mapping', + req: { + index: { + type: 'list' + } + } } ], needBody: true, @@ -4201,10 +4192,11 @@ api.indices.prototype.putMapping = ca({ }); /** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-update-settings.html) request + * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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) @@ -4218,6 +4210,9 @@ api.indices.prototype.putSettings = ca({ type: 'time', name: 'master_timeout' }, + timeout: { + type: 'time' + }, preserveExisting: { type: 'boolean', name: 'preserve_existing' @@ -4264,9 +4259,10 @@ api.indices.prototype.putSettings = ca({ }); /** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html) request + * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one * @param {<>} params.timeout - Explicit operation timeout @@ -4276,6 +4272,10 @@ api.indices.prototype.putSettings = ca({ */ api.indices.prototype.putTemplate = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, order: { type: 'number' }, @@ -4308,7 +4308,7 @@ api.indices.prototype.putTemplate = ca({ }); /** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-recovery.html) request + * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-recovery.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.detailed - Whether to display detailed information about shard recovery @@ -4343,7 +4343,7 @@ api.indices.prototype.recovery = ca({ }); /** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-refresh.html) request + * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-refresh.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -4390,9 +4390,10 @@ api.indices.prototype.refresh = ca({ }); /** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-rollover-index.html) request + * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-rollover-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.includeTypeName - Whether a type should be included in the body of the mappings. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false * @param {<>} params.masterTimeout - Specify timeout for connection to master @@ -4402,6 +4403,10 @@ api.indices.prototype.refresh = ca({ */ api.indices.prototype.rollover = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, timeout: { type: 'time' }, @@ -4443,13 +4448,12 @@ api.indices.prototype.rollover = ca({ }); /** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-segments.html) request + * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-segments.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? * @param {<>} params.verbose - Includes detailed memory usage by Lucene. * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ @@ -4474,9 +4478,6 @@ api.indices.prototype.segments = ca({ ], name: 'expand_wildcards' }, - operationThreading: { - name: 'operation_threading' - }, verbose: { type: 'boolean', 'default': false @@ -4498,14 +4499,13 @@ api.indices.prototype.segments = ca({ }); /** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-shards-stores.html) request + * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-shards-stores.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? * @param {<>, <>, <>} 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({ @@ -4537,9 +4537,6 @@ api.indices.prototype.shardStores = ca({ 'all' ], name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' } }, urls: [ @@ -4558,9 +4555,10 @@ api.indices.prototype.shardStores = ca({ }); /** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-shrink-index.html) request + * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-shrink-index.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.copySettings - whether or not to copy settings from the source index (defaults to false) * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. @@ -4569,6 +4567,10 @@ api.indices.prototype.shardStores = ca({ */ api.indices.prototype.shrink = ca({ params: { + copySettings: { + type: 'boolean', + name: 'copy_settings' + }, timeout: { type: 'time' }, @@ -4596,7 +4598,50 @@ api.indices.prototype.shrink = ca({ }); /** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-stats.html) request + * Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-split-index.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.copySettings - whether or not to copy settings from the source index (defaults to false) + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. + * @param {<>} params.index - The name of the source index to split + * @param {<>} params.target - The name of the target index to split into + */ +api.indices.prototype.split = ca({ + params: { + copySettings: { + type: 'boolean', + name: 'copy_settings' + }, + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + waitForActiveShards: { + type: 'string', + name: 'wait_for_active_shards' + } + }, + url: { + fmt: '/<%=index%>/_split/<%=target%>', + req: { + index: { + type: 'string' + }, + target: { + type: 'string' + } + } + }, + method: 'POST' +}); + +/** + * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) @@ -4662,7 +4707,6 @@ api.indices.prototype.stats = ca({ 'get', 'indexing', 'merge', - 'percolate', 'request_cache', 'refresh', 'search', @@ -4689,7 +4733,6 @@ api.indices.prototype.stats = ca({ 'get', 'indexing', 'merge', - 'percolate', 'request_cache', 'refresh', 'search', @@ -4716,7 +4759,7 @@ api.indices.prototype.stats = ca({ }); /** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request + * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.timeout - Request timeout @@ -4740,7 +4783,7 @@ api.indices.prototype.updateAliases = ca({ }); /** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-upgrade.html) request + * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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) @@ -4797,14 +4840,13 @@ api.indices.prototype.upgrade = ca({ }); /** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-validate.html) request + * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-validate.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.explain - Return detailed information about the error * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? * @param {<>} params.q - Query in the Lucene query string syntax * @param {<>} params.analyzer - The analyzer to use for the query string * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) @@ -4840,9 +4882,6 @@ api.indices.prototype.validateQuery = ca({ ], name: 'expand_wildcards' }, - operationThreading: { - name: 'operation_threading' - }, q: { type: 'string' }, @@ -4904,7 +4943,7 @@ api.indices.prototype.validateQuery = ca({ }); /** - * Perform a [info](https://www.elastic.co/guide/) request + * Perform a [info](http://www.elastic.co/guide/) request * * @param {Object} params - An object with parameters used to carry out this action */ @@ -4917,7 +4956,7 @@ api.info = ca({ api.ingest = namespace(); /** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html) request + * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/7.x/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -4946,7 +4985,7 @@ api.ingest.prototype.deletePipeline = ca({ }); /** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html) request + * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/7.x/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -4975,7 +5014,18 @@ api.ingest.prototype.getPipeline = ca({ }); /** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html) request + * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/7.x/ingest.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.ingest.prototype.processorGrok = ca({ + url: { + fmt: '/_ingest/processor/grok' + } +}); + +/** + * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/7.x/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -5005,7 +5055,7 @@ api.ingest.prototype.putPipeline = ca({ }); /** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html) request + * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/7.x/ingest.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline @@ -5036,7 +5086,7 @@ api.ingest.prototype.simulate = ca({ }); /** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-multi-get.html) request + * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-multi-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response @@ -5045,8 +5095,8 @@ api.ingest.prototype.simulate = ca({ * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation * @param {<>} params.routing - Specific routing value * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.index - The name of the index * @param {<>} params.type - The type of the document */ @@ -5071,13 +5121,13 @@ api.mget = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' } }, urls: [ @@ -5109,73 +5159,16 @@ api.mget = ca({ }); /** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-multi-search.html) request + * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.searchType - Search operation type * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default */ @@ -5198,6 +5191,26 @@ api.msearch = ca({ typedKeys: { type: 'boolean', name: 'typed_keys' + }, + preFilterShardSize: { + type: 'number', + 'default': 128, + name: 'pre_filter_shard_size' + }, + maxConcurrentShardRequests: { + type: 'number', + 'default': 'The default grows with the number of nodes in the cluster but is at most 256.', + name: 'max_concurrent_shard_requests' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -5230,11 +5243,14 @@ api.msearch = ca({ }); /** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request + * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.searchType - Search operation type * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default */ @@ -5253,6 +5269,20 @@ api.msearchTemplate = ca({ typedKeys: { type: 'boolean', name: 'typed_keys' + }, + maxConcurrentSearches: { + type: 'number', + name: 'max_concurrent_searches' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -5285,7 +5315,7 @@ api.msearchTemplate = ca({ }); /** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-multi-termvectors.html) request + * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-multi-termvectors.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body @@ -5401,7 +5431,7 @@ api.mtermvectors = ca({ api.nodes = namespace(); /** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-hot-threads.html) request + * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-hot-threads.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.interval - The interval for the second sampling of threads @@ -5455,7 +5485,7 @@ api.nodes.prototype.hotThreads = ca({ }); /** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-info.html) request + * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-info.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.flatSettings - Return settings in flat format (default: false) @@ -5530,7 +5560,36 @@ api.nodes.prototype.info = ca({ }); /** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-stats.html) request + * Perform a [nodes.reloadSecureSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/secure-settings.html#reloadable-secure-settings) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. + */ +api.nodes.prototype.reloadSecureSettings = ca({ + params: { + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/reload_secure_settings', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/reload_secure_settings' + } + ], + method: 'POST' +}); + +/** + * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) @@ -5617,7 +5676,6 @@ api.nodes.prototype.stats = ca({ 'get', 'indexing', 'merge', - 'percolate', 'request_cache', 'refresh', 'search', @@ -5684,7 +5742,6 @@ api.nodes.prototype.stats = ca({ 'get', 'indexing', 'merge', - 'percolate', 'request_cache', 'refresh', 'search', @@ -5732,33 +5789,131 @@ api.nodes.prototype.stats = ca({ }); /** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html) request + * Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-usage.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics + * @param {<>, <>, <>} 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.usage = ca({ + params: { + timeout: { + type: 'time' + } + }, + urls: [ + { + fmt: '/_nodes/<%=nodeId%>/usage/<%=metric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'rest_actions' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>/usage', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_nodes/usage/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'rest_actions' + ] + } + } + }, + { + fmt: '/_nodes/usage' + } + ] +}); + +/** + * 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: '/' + }, + method: 'HEAD' +}); + +/** + * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.timeout - Explicit operation timeout + * @param {<>} params.masterTimeout - Specify timeout for connection to master + * @param {<>} params.context - Script context + * @param {<>} params.id - Script ID + */ +api.putScript = ca({ + params: { + timeout: { + type: 'time' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + context: { + type: 'string' + } + }, + urls: [ + { + fmt: '/_scripts/<%=id%>/<%=context%>', + req: { + id: { + type: 'string' + }, + context: { + type: 'string' + } + } + }, + { + fmt: '/_scripts/<%=id%>', + req: { + id: { + type: 'string' + } + } + } + ], + needBody: true, + method: 'PUT' +}); + +/** + * Perform a [rankEval](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-rank-eval.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} 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. + * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices */ -api.percolate = ca({ +api.rankEval = ca({ params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' @@ -5777,140 +5932,27 @@ api.percolate = ca({ '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', + fmt: '/<%=index%>/_rank_eval', req: { index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + type: 'list' } } }, { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } + fmt: '/_rank_eval' } ], + needBody: true, method: 'POST' }); /** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} 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/5.4/docs-reindex.html) request + * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-reindex.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.refresh - Should the effected indexes be refreshed? @@ -5956,7 +5998,7 @@ api.reindex = ca({ }); /** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-reindex.html) request + * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-reindex.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. @@ -5981,21 +6023,8 @@ api.reindexRethrottle = ca({ method: 'POST' }); -api.remote = namespace(); - /** - * Perform a [remote.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.remote.prototype.info = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request + * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-template.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.id - The id of the stored search template @@ -6018,11 +6047,24 @@ api.renderSearchTemplate = ca({ }); /** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-scroll.html) request + * Perform a [scriptsPainlessExecute](https://www.elastic.co/guide/en/elasticsearch/painless/7.x/painless-execute-api.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.scriptsPainlessExecute = ca({ + url: { + fmt: '/_scripts/painless/_execute' + }, + method: 'POST' +}); + +/** + * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search * @param {<>} params.scrollId - The scroll ID + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response */ api.scroll = ca({ params: { @@ -6032,6 +6074,11 @@ api.scroll = ca({ scrollId: { type: 'string', name: 'scroll_id' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' } }, urls: [ @@ -6055,19 +6102,20 @@ api.scroll = ca({ }); /** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-search.html) request + * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) * @param {<>} params.df - The field to use as default where no field prefix is given in the query string * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit * @param {<>} params.from - Starting offset (default: 0) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {<>} params.ignoreThrottled - Whether specified concrete, expanded or aliased indices should be ignored when throttled * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored @@ -6079,8 +6127,8 @@ api.scroll = ca({ * @param {<>} params.size - Number of hits to return (default: 10) * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes * @param {<>} params.suggestField - Specify which field to use for suggestions @@ -6089,10 +6137,16 @@ api.scroll = ca({ * @param {<>} params.suggestText - The source text for which the suggestions should be returned * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting + * @param {<>} params.trackTotalHits - Indicate if the number of documents that match the query should be tracked + * @param {<>} [params.allowPartialSearchResults=true] - Indicate if an error should be returned if there is a partial search failure or timeout * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response * @param {<>} params.version - Specify whether to return document version as part of a hit + * @param {<>} params.seqNoPrimaryTerm - Specify whether to return sequence number and primary term of the last modification of each hit * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. + * @param {<>} [params.maxConcurrentShardRequests=The default is 5.] - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -6105,6 +6159,11 @@ api.search = ca({ type: 'boolean', name: 'analyze_wildcard' }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' + }, defaultOperator: { type: 'enum', 'default': 'OR', @@ -6128,10 +6187,6 @@ api.search = ca({ type: 'list', name: 'docvalue_fields' }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, from: { type: 'number' }, @@ -6139,6 +6194,10 @@ api.search = ca({ type: 'boolean', name: 'ignore_unavailable' }, + ignoreThrottled: { + type: 'boolean', + name: 'ignore_throttled' + }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -6186,13 +6245,13 @@ api.search = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, terminateAfter: { type: 'number', @@ -6230,6 +6289,15 @@ api.search = ca({ type: 'boolean', name: 'track_scores' }, + trackTotalHits: { + type: 'boolean', + name: 'track_total_hits' + }, + allowPartialSearchResults: { + type: 'boolean', + 'default': true, + name: 'allow_partial_search_results' + }, typedKeys: { type: 'boolean', name: 'typed_keys' @@ -6237,6 +6305,10 @@ api.search = ca({ version: { type: 'boolean' }, + seqNoPrimaryTerm: { + type: 'boolean', + name: 'seq_no_primary_term' + }, requestCache: { type: 'boolean', name: 'request_cache' @@ -6245,6 +6317,21 @@ api.search = ca({ type: 'number', 'default': 512, name: 'batched_reduce_size' + }, + maxConcurrentShardRequests: { + type: 'number', + 'default': 'The default is 5.', + name: 'max_concurrent_shard_requests' + }, + preFilterShardSize: { + type: 'number', + 'default': 128, + name: 'pre_filter_shard_size' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' } }, urls: [ @@ -6275,7 +6362,7 @@ api.search = ca({ }); /** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-shards.html) request + * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-shards.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) @@ -6285,7 +6372,6 @@ api.search = ca({ * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ api.searchShards = ca({ params: { @@ -6319,17 +6405,6 @@ api.searchShards = ca({ } }, urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, { fmt: '/<%=index%>/_search_shards', req: { @@ -6346,10 +6421,11 @@ api.searchShards = ca({ }); /** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request + * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-template.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {<>} params.ignoreThrottled - Whether specified concrete, expanded or aliased indices should be ignored when throttled * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) @@ -6359,6 +6435,8 @@ api.searchShards = ca({ * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit * @param {<>} params.profile - Specify whether to profile the query execution * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -6368,6 +6446,10 @@ api.searchTemplate = ca({ type: 'boolean', name: 'ignore_unavailable' }, + ignoreThrottled: { + type: 'boolean', + name: 'ignore_throttled' + }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -6411,6 +6493,16 @@ api.searchTemplate = ca({ typedKeys: { type: 'boolean', name: 'typed_keys' + }, + restTotalHitsAsInt: { + type: 'boolean', + 'default': false, + name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -6437,13 +6529,14 @@ api.searchTemplate = ca({ fmt: '/_search/template' } ], + needBody: true, method: 'POST' }); api.snapshot = namespace(); /** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6478,7 +6571,7 @@ api.snapshot.prototype.create = ca({ }); /** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6512,7 +6605,7 @@ api.snapshot.prototype.createRepository = ca({ }); /** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6541,7 +6634,7 @@ api.snapshot.prototype['delete'] = ca({ }); /** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6570,11 +6663,12 @@ api.snapshot.prototype.deleteRepository = ca({ }); /** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * @param {<>} params.verbose - Whether to show verbose snapshot info or only show the basic info found in the repository index blob * @param {<>} params.repository - A repository name * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names */ @@ -6587,6 +6681,9 @@ api.snapshot.prototype.get = ca({ ignoreUnavailable: { type: 'boolean', name: 'ignore_unavailable' + }, + verbose: { + type: 'boolean' } }, url: { @@ -6603,7 +6700,7 @@ api.snapshot.prototype.get = ca({ }); /** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6636,7 +6733,7 @@ api.snapshot.prototype.getRepository = ca({ }); /** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6671,7 +6768,7 @@ api.snapshot.prototype.restore = ca({ }); /** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6717,7 +6814,7 @@ api.snapshot.prototype.status = ca({ }); /** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request + * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node @@ -6745,90 +6842,28 @@ api.snapshot.prototype.verifyRepository = ca({ method: 'POST' }); -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} 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](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html) request + * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.nodes - 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. + * @param {<>} params.parentTaskId - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. * @param {<>} 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' + nodes: { + type: 'list' }, actions: { type: 'list' }, - parentNode: { + parentTaskId: { type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' + name: 'parent_task_id' } }, urls: [ @@ -6848,10 +6883,11 @@ api.tasks.prototype.cancel = ca({ }); /** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html) request + * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) + * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) */ api.tasks.prototype.get = ca({ @@ -6859,6 +6895,9 @@ api.tasks.prototype.get = ca({ waitForCompletion: { type: 'boolean', name: 'wait_for_completion' + }, + timeout: { + type: 'time' } }, url: { @@ -6872,22 +6911,21 @@ api.tasks.prototype.get = ca({ }); /** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html) request + * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} 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 {<>, <>, <>} params.nodes - 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 {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + * @param {<>} params.parentTaskId - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships + * @param {<>} params.timeout - Explicit operation timeout */ api.tasks.prototype.list = ca({ params: { - nodeId: { - type: 'list', - name: 'node_id' + nodes: { + type: 'list' }, actions: { type: 'list' @@ -6895,13 +6933,9 @@ api.tasks.prototype.list = ca({ detailed: { type: 'boolean' }, - parentNode: { + parentTaskId: { type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' + name: 'parent_task_id' }, waitForCompletion: { type: 'boolean', @@ -6912,9 +6946,13 @@ api.tasks.prototype.list = ca({ 'default': 'nodes', options: [ 'nodes', - 'parents' + 'parents', + 'none' ], name: 'group_by' + }, + timeout: { + type: 'time' } }, url: { @@ -6923,7 +6961,7 @@ api.tasks.prototype.list = ca({ }); /** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-termvectors.html) request + * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-termvectors.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. @@ -7020,6 +7058,17 @@ api.termvectors = ca({ } } }, + { + fmt: '/<%=index%>/_termvectors/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, { fmt: '/<%=index%>/<%=type%>/_termvectors', req: { @@ -7030,30 +7079,35 @@ api.termvectors = ca({ type: 'string' } } + }, + { + fmt: '/<%=index%>/_termvectors/', + req: { + index: { + type: 'string' + } + } } ], method: 'POST' }); /** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update.html) request + * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} 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 {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.lang - The script language (default: painless) * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request * @param {<>} 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 {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) * @param {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type + * @param {<>} params.ifSeqNo - only perform the update operation if the last operation that has changed the document has the specified sequence number + * @param {<>} params.ifPrimaryTerm - only perform the update operation if the last operation that has changed the document has the specified primary term * @param {<>} params.id - Document ID * @param {<>} params.index - The name of the index * @param {<>} params.type - The type of the document @@ -7064,19 +7118,16 @@ api.update = ca({ type: 'string', name: 'wait_for_active_shards' }, - fields: { - type: 'list' - }, _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, lang: { type: 'string' @@ -7103,43 +7154,48 @@ api.update = ca({ timeout: { type: 'time' }, - timestamp: { - type: 'time' + ifSeqNo: { + type: 'number', + name: 'if_seq_no' }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' + ifPrimaryTerm: { + type: 'number', + name: 'if_primary_term' } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/_update/<%=id%>', + req: { + index: { + type: 'string' + }, + id: { + type: 'string' + } } } - }, + ], + needBody: true, method: 'POST' }); /** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update-by-query.html) request + * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string @@ -7162,8 +7218,8 @@ api.update = ca({ * @param {<>} params.size - Number of hits to return (default: 10) * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {<>, <>, <>} params._sourceExcludes - A list of fields to exclude from the returned _source field + * @param {<>, <>, <>} params._sourceIncludes - A list of fields to extract and return from the _source field * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes * @param {<>} params.version - Specify whether to return document version as part of a hit @@ -7172,7 +7228,7 @@ api.update = ca({ * @param {<>} params.refresh - Should the effected indexes be refreshed? * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. * @param {<>} 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 {<>} params.scrollSize - Size on the scroll request powering the update_by_query + * @param {<>} params.scrollSize - Size on the scroll request powering the update by query * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. @@ -7269,13 +7325,13 @@ api.updateByQuery = ca({ _source: { type: 'list' }, - _sourceExclude: { + _sourceExcludes: { type: 'list', - name: '_source_exclude' + name: '_source_excludes' }, - _sourceInclude: { + _sourceIncludes: { type: 'list', - name: '_source_include' + name: '_source_includes' }, terminateAfter: { type: 'number', @@ -7348,3 +7404,29 @@ api.updateByQuery = ca({ ], method: 'POST' }); + +/** + * Perform a [updateByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update-by-query.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * @param {<>} params.taskId - The task id to rethrottle + */ +api.updateByQueryRethrottle = ca({ + params: { + requestsPerSecond: { + type: 'number', + required: true, + name: 'requests_per_second' + } + }, + url: { + fmt: '/_update_by_query/<%=taskId%>/_rethrottle', + req: { + taskId: { + type: 'string' + } + } + }, + method: 'POST' +}); diff --git a/src/lib/apis/browser_index.js b/src/lib/apis/browser_index.js index 55363510a..4f2d774ee 100644 --- a/src/lib/apis/browser_index.js +++ b/src/lib/apis/browser_index.js @@ -1,10 +1,12 @@ module.exports = { + '_default': require('./6_6'), '6.6': require('./6_6'), - '_default': require('./6_5'), '6.5': require('./6_5'), '6.4': require('./6_4'), '6.3': require('./6_3'), '6.2': require('./6_2'), - '6.x': require('./6_x'), + '6.7': require('./6_7'), + '7.0': require('./7_0'), + '7.x': require('./7_x'), 'master': require('./master') }; diff --git a/src/lib/apis/index.js b/src/lib/apis/index.js index 0aadea6d7..68b6eca4c 100644 --- a/src/lib/apis/index.js +++ b/src/lib/apis/index.js @@ -1,6 +1,6 @@ module.exports = { + get '_default'() { return require('./6_6'); }, get '6.6'() { return require('./6_6'); }, - get '_default'() { return require('./6_5'); }, get '6.5'() { return require('./6_5'); }, get '6.4'() { return require('./6_4'); }, get '6.3'() { return require('./6_3'); }, @@ -8,15 +8,11 @@ module.exports = { get '6.1'() { return require('./6_1'); }, get '6.0'() { return require('./6_0'); }, get '5.6'() { return require('./5_6'); }, - get '5.5'() { return require('./5_5'); }, - get '5.4'() { return require('./5_4'); }, - get '5.3'() { return require('./5_3'); }, - get '5.2'() { return require('./5_2'); }, - get '5.1'() { return require('./5_1'); }, - get '5.0'() { return require('./5_0'); }, get '2.4'() { return require('./2_4'); }, get '1.7'() { return require('./1_7'); }, get '0.90'() { return require('./0_90'); }, - get '6.x'() { return require('./6_x'); }, + get '6.7'() { return require('./6_7'); }, + get '7.0'() { return require('./7_0'); }, + get '7.x'() { return require('./7_x'); }, get 'master'() { return require('./master'); }, }; diff --git a/src/lib/apis/master.js b/src/lib/apis/master.js index 28bbacb5b..c60a2d7f8 100644 --- a/src/lib/apis/master.js +++ b/src/lib/apis/master.js @@ -3021,7 +3021,7 @@ api.indices.prototype.close = ca({ * Perform a [indices.create](https://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 {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. + * @param {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master @@ -3030,7 +3030,7 @@ api.indices.prototype.close = ca({ api.indices.prototype.create = ca({ params: { includeTypeName: { - type: 'string', + type: 'boolean', name: 'include_type_name' }, waitForActiveShards: { @@ -3674,6 +3674,7 @@ api.indices.prototype.getAlias = ca({ * Perform a [indices.getFieldMapping](https://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 {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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) @@ -3685,6 +3686,10 @@ api.indices.prototype.getAlias = ca({ */ api.indices.prototype.getFieldMapping = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, includeDefaults: { type: 'boolean', name: 'include_defaults' @@ -3764,7 +3769,7 @@ api.indices.prototype.getFieldMapping = ca({ * Perform a [indices.getMapping](https://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 {<>} params.includeTypeName - Whether to add the type name to the response + * @param {<>} params.includeTypeName - Whether to add the type name to the response (default: false) * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {<>} 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 {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -3776,7 +3781,7 @@ api.indices.prototype.getFieldMapping = ca({ api.indices.prototype.getMapping = ca({ params: { includeTypeName: { - type: 'string', + type: 'boolean', name: 'include_type_name' }, ignoreUnavailable: { @@ -3933,6 +3938,7 @@ api.indices.prototype.getSettings = ca({ * Perform a [indices.getTemplate](https://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 {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.flatSettings - Return settings in flat format (default: false) * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) @@ -3940,6 +3946,10 @@ api.indices.prototype.getSettings = ca({ */ api.indices.prototype.getTemplate = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, flatSettings: { type: 'boolean', name: 'flat_settings' @@ -4106,7 +4116,7 @@ api.indices.prototype.putAlias = ca({ * Perform a [indices.putMapping](https://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 {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. + * @param {<>} params.includeTypeName - Whether a type should be expected in the body of the mappings. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.masterTimeout - Specify timeout for connection to master * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -4118,7 +4128,7 @@ api.indices.prototype.putAlias = ca({ api.indices.prototype.putMapping = ca({ params: { includeTypeName: { - type: 'string', + type: 'boolean', name: 'include_type_name' }, timeout: { @@ -4252,6 +4262,7 @@ api.indices.prototype.putSettings = ca({ * Perform a [indices.putTemplate](https://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 {<>} params.includeTypeName - Whether a type should be returned in the body of the mappings. * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one * @param {<>} params.timeout - Explicit operation timeout @@ -4261,6 +4272,10 @@ api.indices.prototype.putSettings = ca({ */ api.indices.prototype.putTemplate = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, order: { type: 'number' }, @@ -4378,6 +4393,7 @@ api.indices.prototype.refresh = ca({ * Perform a [indices.rollover](https://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 {<>} params.includeTypeName - Whether a type should be included in the body of the mappings. * @param {<>} params.timeout - Explicit operation timeout * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false * @param {<>} params.masterTimeout - Specify timeout for connection to master @@ -4387,6 +4403,10 @@ api.indices.prototype.refresh = ca({ */ api.indices.prototype.rollover = ca({ params: { + includeTypeName: { + type: 'boolean', + name: 'include_type_name' + }, timeout: { type: 'time' }, @@ -5148,6 +5168,7 @@ api.mget = ca({ * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default */ @@ -5185,6 +5206,11 @@ api.msearch = ca({ type: 'boolean', 'default': false, name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -5224,6 +5250,7 @@ api.msearch = ca({ * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default */ @@ -5251,6 +5278,11 @@ api.msearchTemplate = ca({ type: 'boolean', 'default': false, name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -6075,6 +6107,7 @@ api.scroll = ca({ * @param {Object} params - An object with parameters used to carry out this action * @param {<>} params.analyzer - The analyzer to use for the query string * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) * @param {<>} params.df - The field to use as default where no field prefix is given in the query string * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit @@ -6108,6 +6141,7 @@ api.scroll = ca({ * @param {<>} [params.allowPartialSearchResults=true] - Indicate if an error should be returned if there is a partial search failure or timeout * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response * @param {<>} params.version - Specify whether to return document version as part of a hit + * @param {<>} params.seqNoPrimaryTerm - Specify whether to return sequence number and primary term of the last modification of each hit * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. * @param {<>} [params.maxConcurrentShardRequests=The default is 5.] - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests @@ -6125,6 +6159,11 @@ api.search = ca({ type: 'boolean', name: 'analyze_wildcard' }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' + }, defaultOperator: { type: 'enum', 'default': 'OR', @@ -6266,6 +6305,10 @@ api.search = ca({ version: { type: 'boolean' }, + seqNoPrimaryTerm: { + type: 'boolean', + name: 'seq_no_primary_term' + }, requestCache: { type: 'boolean', name: 'request_cache' @@ -6393,6 +6436,7 @@ api.searchShards = ca({ * @param {<>} params.profile - Specify whether to profile the query execution * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response * @param {<>} params.restTotalHitsAsInt - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {<>} [params.ccsMinimizeRoundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ @@ -6454,6 +6498,11 @@ api.searchTemplate = ca({ type: 'boolean', 'default': false, name: 'rest_total_hits_as_int' + }, + ccsMinimizeRoundtrips: { + type: 'boolean', + 'default': 'true', + name: 'ccs_minimize_roundtrips' } }, urls: [ @@ -7057,8 +7106,8 @@ api.termvectors = ca({ * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) * @param {<>} params.routing - Specific routing value * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type + * @param {<>} params.ifSeqNo - only perform the update operation if the last operation that has changed the document has the specified sequence number + * @param {<>} params.ifPrimaryTerm - only perform the update operation if the last operation that has changed the document has the specified primary term * @param {<>} params.id - Document ID * @param {<>} params.index - The name of the index * @param {<>} params.type - The type of the document @@ -7105,16 +7154,13 @@ api.update = ca({ timeout: { type: 'time' }, - version: { - type: 'number' + ifSeqNo: { + type: 'number', + name: 'if_seq_no' }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' + ifPrimaryTerm: { + type: 'number', + name: 'if_primary_term' } }, urls: [