diff --git a/.gitmodules b/.gitmodules index d079bc5df..08778435c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "src/elasticsearch"] path = src/elasticsearch - url = https://github.com/spenceralger/elasticsearch.git + url = https://github.com/elasticsearch/elasticsearch.git diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index 8b51a1664..3c2ee5331 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -12,7 +12,7 @@ client.bulk([params, [callback]]) Perform many index/delete operations in a single API call. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/bulk/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html[the elasticsearch docs] for more about this method. .Perform three operations in a single request [source,js] @@ -46,13 +46,280 @@ client.bulk({ `Boolean` -- Refresh the index after performing the operation `[replication=sync]`:: `String` -- Explicitely set the replication type -`type`:: -`String` -- Default document type for items which don't provide one +`routing`:: +`String` -- Specific routing value `timeout`:: `Date, Number` -- Explicit operation timeout +`type`:: +`String` -- Default document type for items which don't provide one `index`:: `String` -- Default index for items which don't provide one +[[api-cat-aliases]] +=== `cat.aliases` + +[source,js] +-------- +client.cat.aliases([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-aliases.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`name`:: +`String, String[], Boolean` -- A comma-separated list of alias names to return + +[[api-cat-allocation]] +=== `cat.allocation` + +[source,js] +-------- +client.cat.allocation([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-allocation.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information + +[[api-cat-health]] +=== `cat.health` + +[source,js] +-------- +client.cat.health([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-health.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +[[api-cat-help]] +=== `cat.help` + +[source,js] +-------- +client.cat.help([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`help`:: +`Boolean` -- Return help information + +[[api-cat-indices]] +=== `cat.indices` + +[source,js] +-------- +client.cat.indices([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-indices.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`bytes`:: +`String` -- The unit in which to display byte values +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + +[[api-cat-master]] +=== `cat.master` + +[source,js] +-------- +client.cat.master([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-master.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +[[api-cat-nodes]] +=== `cat.nodes` + +[source,js] +-------- +client.cat.nodes([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-nodes.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +[[api-cat-pendingtasks]] +=== `cat.pendingTasks` + +[source,js] +-------- +client.cat.pendingTasks([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-pending-tasks.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers + +[[api-cat-shards]] +=== `cat.shards` + +[source,js] +-------- +client.cat.shards([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-shards.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`local`:: +`Boolean` -- Return local information, do not retrieve the state from master node (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`h`:: +`String, String[], Boolean` -- Comma-separated list of column names to display +`help`:: +`Boolean` -- Return help information +`v`:: +`Boolean` -- Verbose mode. Display column headers +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to limit the returned information + [[api-clearscroll]] === `clearScroll` @@ -63,7 +330,7 @@ client.clearScroll([params, [callback]]) Clear the scroll request created by specifying the scroll parameter to search. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/search/scroll/[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html[the elasticsearch docs] for more about this method. // no examples @@ -74,6 +341,131 @@ The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`repository`:: +`String` -- A repository name + +[[api-cluster-createsnapshot]] +=== `cluster.createSnapshot` + +[source,js] +-------- +client.cluster.createSnapshot([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`waitForCompletion`:: +`Boolean` -- Should this request wait until the operation has completed before returning +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name + +[[api-cluster-deleterepository]] +=== `cluster.deleteRepository` + +[source,js] +-------- +client.cluster.deleteRepository([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout +`repository`:: +`String, String[], Boolean` -- A comma-separated list of repository names + +[[api-cluster-deletesnapshot]] +=== `cluster.deleteSnapshot` + +[source,js] +-------- +client.cluster.deleteSnapshot([params, [callback]]) +-------- + +// no description + +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name + +[[api-cluster-getrepository]] +=== `cluster.getRepository` + +[source,js] +-------- +client.cluster.getRepository([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String, String[], Boolean` -- A comma-separated list of repository names + [[api-cluster-getsettings]] === `cluster.getSettings` @@ -84,11 +476,45 @@ client.cluster.getSettings([params, [callback]]) Get cluster settings (previously set with `putSettings()`) -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-cluster-update-settings/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html[the elasticsearch docs] for more about this method. // no examples +==== Params + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`timeout`:: +`Date, Number` -- Explicit operation timeout + +[[api-cluster-getsnapshot]] +=== `cluster.getSnapshot` + +[source,js] +-------- +client.cluster.getSnapshot([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`repository`:: +`String, String[], Boolean` -- A comma-separated list of repository names +`snapshot`:: +`String, String[], Boolean` -- A comma-separated list of snapshot names [[api-cluster-health]] === `cluster.health` @@ -100,7 +526,7 @@ client.cluster.health([params, [callback]]) Get a very simple status on the health of the cluster. -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-cluster-health/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html[the elasticsearch docs] for more about this method. // no examples @@ -139,7 +565,7 @@ Returns information about the hottest threads in the cluster or on a specific no WARNING: This endpoint returns plain text -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-hot-threads/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html[the elasticsearch docs] for more about this method. .Return 10 hottest threads [source,js] @@ -178,7 +604,7 @@ client.cluster.nodeInfo([params, [callback]]) Retrieve one or more (or all) of the cluster nodes' information. -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-info/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-info.html[the elasticsearch docs] for more about this method. .Return information about JVM [source,js] @@ -195,32 +621,14 @@ client.cluster.nodeInfo({ jvm: true }) ==== Params [horizontal] -`all`:: -`Boolean` -- Return all available information -`clear`:: -`Boolean` -- Reset the default settings -`http`:: -`Boolean` -- Return information about HTTP -`jvm`:: -`Boolean` -- Return information about the JVM -`network`:: -`Boolean` -- Return information about network -`os`:: -`Boolean` -- Return information about the operating system -`plugin`:: -`Boolean` -- Return information about plugins -`process`:: -`Boolean` -- Return information about the Elasticsearch process -`settings`:: -`Boolean` -- Return information about node settings -`threadPool`:: -`Boolean` -- Return information about the thread pool -`timeout`:: -`Date, Number` -- Explicit operation timeout -`transport`:: -`Boolean` -- Return information about transport +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. `nodeId`:: `String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes +`metric`:: +`String, String[], Boolean` -- A comma-separated list of metrics you wish returned. Leave empty to return all. [[api-cluster-nodeshutdown]] === `cluster.nodeShutdown` @@ -232,7 +640,7 @@ client.cluster.nodeShutdown([params, [callback]]) Shutdown one or more (or all) nodes in the cluster. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html[the elasticsearch docs] for more about this method. // no examples @@ -257,7 +665,7 @@ client.cluster.nodeStats([params, [callback]]) Retrieve one or more (or all) of the cluster nodes statistics. -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-stats/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html[the elasticsearch docs] for more about this method. // no examples @@ -265,34 +673,24 @@ The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-cluster-update-settings/[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html[the elasticsearch docs] for more about this method. // no examples +==== Params + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) [[api-cluster-reroute]] === `cluster.reroute` @@ -322,7 +725,7 @@ client.cluster.reroute([params, [callback]]) Explicitly execute a cluster reroute allocation command including specific commands. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-cluster-reroute/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-reroute.html[the elasticsearch docs] for more about this method. // no examples @@ -334,6 +737,37 @@ The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`masterTimeout`:: +`Date, Number` -- Explicit operation timeout for connection to master node +`waitForCompletion`:: +`Boolean` -- Should this request wait until the operation has completed before returning +`repository`:: +`String` -- A repository name +`snapshot`:: +`String` -- A snapshot name [[api-cluster-state]] === `cluster.state` @@ -345,7 +779,7 @@ client.cluster.state([params, [callback]]) Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-cluster-state/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-state.html[the elasticsearch docs] for more about this method. // no examples @@ -353,22 +787,57 @@ The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-stats.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`flatSettings`:: +`Boolean` -- Return settings in flat format (default: false) +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`nodeId`:: +`String, String[], Boolean` -- A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + +[[api-cluster-tasks]] +=== `cluster.tasks` + +[source,js] +-------- +client.cluster.tasks([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-pending.html[the elasticsearch docs] for more about this method. + +// no examples + + [[api-count]] === `count` @@ -380,7 +849,7 @@ client.count([params, [callback]]) Get the number of documents for the cluster, index, type, or a query. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/count/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-count.html[the elasticsearch docs] for more about this method. .Get the number of all documents in the cluster [source,js] @@ -453,7 +922,7 @@ client.create([params, [callback]]) Adds a typed JSON document in a specific index, making it searchable. If a document with the same `index`, `type`, and `id` already exists, an error will occur. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/index_/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html[the elasticsearch docs] for more about this method. .Create a document [source,js] @@ -517,7 +986,7 @@ client.delete([params, [callback]]) Delete a typed JSON document from a specific index based on its id. -The default method is `DELETE` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/delete/[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html[the elasticsearch docs] for more about this method. .Delete the document `/myindex/mytype/1` [source,js] @@ -568,7 +1037,7 @@ client.deleteByQuery([params, [callback]]) Delete documents from one or more indices and one or more types based on a query. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/delete-by-query/[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html[the elasticsearch docs] for more about this method. .Deleting documents with a simple query [source,js] @@ -637,7 +1106,7 @@ client.exists([params, [callback]]) Returns a boolean indicating whether or not a given document exists. -The default method is `HEAD` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/get/[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html[the elasticsearch docs] for more about this method. .Check that the document `/myindex/mytype/1` exits [source,js] @@ -673,7 +1142,7 @@ client.exists({ `String` -- The document ID `index`:: `String` -- The name of the index -`[type=_all]`:: +`type`:: `String` -- The type of the document (use `_all` to fetch the first document matching the ID across all types) [[api-explain]] @@ -686,7 +1155,7 @@ client.explain([params, [callback]]) Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. Also check out http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html[percolaters]. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/explain/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-explain.html[the elasticsearch docs] for more about this method. .See how a document is scored against a simple query [source,js] @@ -772,7 +1241,7 @@ client.get([params, [callback]]) Get a typed JSON document from the index based on its id. -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/get/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html[the elasticsearch docs] for more about this method. .Get `/myindex/mytype/1` [source,js] @@ -808,11 +1277,15 @@ client.get({ `String, String[], Boolean` -- A list of fields to exclude from the returned _source field `_sourceInclude`:: `String, String[], Boolean` -- A list of fields to extract and return from the _source field +`version`:: +`Number` -- Explicit version number for concurrency control +`versionType`:: +`String` -- Specific version type `id`:: `String` -- The document ID `index`:: `String` -- The name of the index -`[type=_all]`:: +`type`:: `String` -- The type of the document (use `_all` to fetch the first document matching the ID across all types) [[api-getsource]] @@ -825,7 +1298,7 @@ client.getSource([params, [callback]]) Get the source of a document by it's index, type and id. -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/get/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html[the elasticsearch docs] for more about this method. // no examples @@ -847,11 +1320,21 @@ The default method is `GET` and the usual <>. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/index_/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html[the elasticsearch docs] for more about this method. .Create or update a document [source,js] @@ -898,8 +1381,6 @@ client.index({ `String` -- Explicit operation type `parent`:: `String` -- ID of the parent document -`percolate`:: -`String` -- Percolator queries to execute while indexing the document `refresh`:: `Boolean` -- Refresh the index after performing the operation `[replication=sync]`:: @@ -933,7 +1414,7 @@ client.indices.analyze([params, [callback]]) Perform the analysis process on a text and return the tokens breakdown of the text. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-analyze.html[the elasticsearch docs] for more about this method. // no examples @@ -968,7 +1449,7 @@ client.indices.clearCache([params, [callback]]) Clear either all caches or specific cached associated with one ore more indices. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-clearcache/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-clearcache.html[the elasticsearch docs] for more about this method. // no examples @@ -1013,7 +1494,7 @@ client.indices.close([params, [callback]]) Close an index to remove it's overhead from the cluster. Closed index is blocked for read/write operations. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html[the elasticsearch docs] for more about this method. // no examples @@ -1044,7 +1525,7 @@ client.indices.create([params, [callback]]) Create an index in Elasticsearch. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html[the elasticsearch docs] for more about this method. // no examples @@ -1069,7 +1550,7 @@ client.indices.delete([params, [callback]]) Delete an index in Elasticsearch -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-index/[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-index.html[the elasticsearch docs] for more about this method. // no examples @@ -1082,7 +1563,7 @@ The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1107,9 +1588,9 @@ The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-mapping/[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1132,9 +1613,9 @@ The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -1171,7 +1652,7 @@ client.indices.deleteWarmer([params, [callback]]) Delete an index warmer. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html[the elasticsearch docs] for more about this method. // no examples @@ -1181,12 +1662,10 @@ The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-indices-exists/[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -1225,7 +1704,7 @@ client.indices.existsAlias([params, [callback]]) Return a boolean indicating whether given alias exists. -The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1244,6 +1723,27 @@ The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`name`:: +`String` -- The name of the template + [[api-indices-existstype]] === `indices.existsType` @@ -1254,7 +1754,7 @@ client.indices.existsType([params, [callback]]) Check if a type/types exists in an index/indices. -The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-types-exists/[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-types-exists.html[the elasticsearch docs] for more about this method. // no examples @@ -1283,7 +1783,7 @@ client.indices.flush([params, [callback]]) Explicitly flush one or more indices. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-flush/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-flush.html[the elasticsearch docs] for more about this method. // no examples @@ -1301,8 +1801,6 @@ The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1345,7 +1843,7 @@ client.indices.getAliases([params, [callback]]) Retrieve specified aliases -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1357,6 +1855,8 @@ The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1415,6 +1917,8 @@ The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-get-settings/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1438,8 +1942,20 @@ The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -1459,6 +1975,8 @@ The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html[the elasticsearch docs] for more about this method. // no examples @@ -1503,7 +2021,7 @@ client.indices.open([params, [callback]]) Open a closed index, making it available for search. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html[the elasticsearch docs] for more about this method. // no examples @@ -1534,7 +2052,7 @@ client.indices.optimize([params, [callback]]) Explicitly optimize one or more indices. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html[the elasticsearch docs] for more about this method. // no examples @@ -1556,8 +2074,6 @@ The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1586,7 +2102,7 @@ The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping/[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1621,7 +2137,7 @@ The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -1651,6 +2167,8 @@ The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -1678,6 +2196,8 @@ The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html[the elasticsearch docs] for more about this method. // no examples @@ -1708,7 +2228,7 @@ The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-refresh/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-refresh.html[the elasticsearch docs] for more about this method. // no examples @@ -1738,6 +2258,8 @@ The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-indices-segments/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-segments.html[the elasticsearch docs] for more about this method. // no examples @@ -1767,6 +2289,8 @@ The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-gateway-snapshot/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-gateway-snapshot.html[the elasticsearch docs] for more about this method. // no examples @@ -1809,7 +2333,7 @@ client.indices.stats([params, [callback]]) Retrieve statistics on different operations happening on an index. -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-indices-stats/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html[the elasticsearch docs] for more about this method. // no examples @@ -1817,58 +2341,24 @@ The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/admin-indices-status/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html[the elasticsearch docs] for more about this method. // no examples @@ -1894,6 +2384,8 @@ The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1938,7 +2430,7 @@ client.indices.validateQuery([params, [callback]]) Validate a potentially expensive query without executing it. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/validate/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-validate.html[the elasticsearch docs] for more about this method. // no examples @@ -1975,7 +2467,7 @@ client.info([params, [callback]]) Get basic info from the current cluster. -The default method is `GET` and the usual <> apply. See http://elasticsearch.org/guide/[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/[the elasticsearch docs] for more about this method. // no examples @@ -1991,7 +2483,7 @@ client.mget([params, [callback]]) Get multiple documents based on an index, type (optional) and ids. The body required by mget can take two forms: an array of document locations, or an array of document ids. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/multi-get/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html[the elasticsearch docs] for more about this method. .An array of doc locations. Useful for getting documents from different indices. [source,js] @@ -2056,7 +2548,7 @@ client.mlt([params, [callback]]) (more like this) Gets more documents that are “like” the document specified using `index`, `type`, and `id`. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/more-like-this/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-more-like-this.html[the elasticsearch docs] for more about this method. .Search for similar documents using the `title` property of document `myindex/mytype/1` [source,js] @@ -2081,13 +2573,13 @@ client.mlt({ `Number` -- The word occurrence frequency as count: words with higher occurrence in the corpus will be ignored `maxQueryTerms`:: `Number` -- The maximum query terms to be included in the generated query -`maxWordLen`:: +`maxWordLength`:: `Number` -- The minimum length of the word: longer words will be ignored `minDocFreq`:: `Number` -- The word occurrence frequency as count: words with lower occurrence in the corpus will be ignored `minTermFreq`:: `Number` -- The term frequency as percent: terms with lower occurence in the source document will be ignored -`minWordLen`:: +`minWordLength`:: `Number` -- The minimum length of the word: shorter words will be ignored `mltFields`:: `String, String[], Boolean` -- Specific fields to perform the query against @@ -2130,7 +2622,7 @@ client.msearch([params, [callback]]) Execute several search requests within the same request. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/multi-search/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-multi-search.html[the elasticsearch docs] for more about this method. .Perform multiple different searches, the body is made up of meta/data pairs [source,js] @@ -2169,7 +2661,7 @@ client.percolate([params, [callback]]) Match a document against registered percolator queries. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/percolate/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html[the elasticsearch docs] for more about this method. .First, Register queries named “alert-1” and “alert-2” for the “myindex” index [source,js] @@ -2252,6 +2744,22 @@ client.percolate({ `type`:: `String` -- The document type +[[api-ping]] +=== `ping` + +[source,js] +-------- +client.ping([params, [callback]]) +-------- + +// no description + +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/[the elasticsearch docs] for more about this method. + +// no examples + + + [[api-scroll]] === `scroll` @@ -2262,7 +2770,7 @@ client.scroll([params, [callback]]) Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/search/scroll/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html[the elasticsearch docs] for more about this method. .Collect every title in the index that contains the word "test" [source,js] @@ -2317,7 +2825,7 @@ TIP: https://github.com/fullscale/elastic.js[elastic.js] can be used to make bui -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/reference/api/search/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html[the elasticsearch docs] for more about this method. .Search with a simple query string query [source,js] @@ -2420,7 +2928,7 @@ client.search({ `Date, Number` -- Explicit operation timeout `version`:: `Boolean` -- Specify whether to return document version as part of a hit -`[index=_all]`:: +`index`:: `String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `type`:: `String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types @@ -2435,7 +2943,7 @@ client.suggest([params, [callback]]) The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/search/suggest/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html[the elasticsearch docs] for more about this method. .Return query terms suggestions (“auto-correction”) [source,js] @@ -2504,7 +3012,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 -The default method is `POST` and the usual <> apply. See http://elasticsearch.org/guide/reference/api/update/[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html[the elasticsearch docs] for more about this method. .Update document title using partial document [source,js] @@ -2588,8 +3096,6 @@ client.update({ `String` -- The script language (default: mvel) `parent`:: `String` -- ID of the parent document -`percolate`:: -`String` -- Perform percolation during the operation; use specific registered query name, attribute, or wildcard `refresh`:: `Boolean` -- Refresh the index after performing the operation `[replication=sync]`:: diff --git a/docs/api_methods_0_90.asciidoc b/docs/api_methods_0_90.asciidoc index 15fe8ac47..77caea0a1 100644 --- a/docs/api_methods_0_90.asciidoc +++ b/docs/api_methods_0_90.asciidoc @@ -12,7 +12,7 @@ client.bulk([params, [callback]]) Perform many index/delete operations in a single API call. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-bulk.html[the elasticsearch docs] for more about this method. .Perform three operations in a single request [source,js] @@ -63,7 +63,7 @@ client.clearScroll([params, [callback]]) Clear the scroll request created by specifying the scroll parameter to search. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-request-scroll.html[the elasticsearch docs] for more about this method. // no examples @@ -84,7 +84,7 @@ client.cluster.getSettings([params, [callback]]) Get cluster settings (previously set with `putSettings()`) -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-update-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -100,7 +100,7 @@ client.cluster.health([params, [callback]]) Get a very simple status on the health of the cluster. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-health.html[the elasticsearch docs] for more about this method. // no examples @@ -139,7 +139,7 @@ Returns information about the hottest threads in the cluster or on a specific no WARNING: This endpoint returns plain text -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-nodes-hot-threads.html[the elasticsearch docs] for more about this method. .Return 10 hottest threads [source,js] @@ -178,7 +178,7 @@ client.cluster.nodeInfo([params, [callback]]) Retrieve one or more (or all) of the cluster nodes' information. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-info.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-nodes-info.html[the elasticsearch docs] for more about this method. .Return information about JVM [source,js] @@ -232,7 +232,7 @@ client.cluster.nodeShutdown([params, [callback]]) Shutdown one or more (or all) nodes in the cluster. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-nodes-shutdown.html[the elasticsearch docs] for more about this method. // no examples @@ -257,7 +257,7 @@ client.cluster.nodeStats([params, [callback]]) Retrieve one or more (or all) of the cluster nodes statistics. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-nodes-stats.html[the elasticsearch docs] for more about this method. // no examples @@ -306,7 +306,7 @@ client.cluster.putSettings([params, [callback]]) Update cluster wide specific settings. -The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-update-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -322,7 +322,7 @@ client.cluster.reroute([params, [callback]]) Explicitly execute a cluster reroute allocation command including specific commands. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-reroute.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-reroute.html[the elasticsearch docs] for more about this method. // no examples @@ -345,7 +345,7 @@ client.cluster.state([params, [callback]]) Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc). -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-state.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-state.html[the elasticsearch docs] for more about this method. // no examples @@ -380,7 +380,7 @@ client.count([params, [callback]]) Get the number of documents for the cluster, index, type, or a query. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-count.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-count.html[the elasticsearch docs] for more about this method. .Get the number of all documents in the cluster [source,js] @@ -449,7 +449,7 @@ client.create([params, [callback]]) Adds a typed JSON document in a specific index, making it searchable. If a document with the same `index`, `type`, and `id` already exists, an error will occur. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-index_.html[the elasticsearch docs] for more about this method. .Create a document [source,js] @@ -513,7 +513,7 @@ client.delete([params, [callback]]) Delete a typed JSON document from a specific index based on its id. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-delete.html[the elasticsearch docs] for more about this method. .Delete the document `/myindex/mytype/1` [source,js] @@ -564,7 +564,7 @@ client.deleteByQuery([params, [callback]]) Delete documents from one or more indices and one or more types based on a query. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-delete-by-query.html[the elasticsearch docs] for more about this method. .Deleting documents with a simple query [source,js] @@ -629,7 +629,7 @@ client.exists([params, [callback]]) Returns a boolean indicating whether or not a given document exists. -The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-get.html[the elasticsearch docs] for more about this method. .Check that the document `/myindex/mytype/1` exits [source,js] @@ -665,7 +665,7 @@ client.exists({ `String` -- The document ID `index`:: `String` -- The name of the index -`[type=_all]`:: +`type`:: `String` -- The type of the document (use `_all` to fetch the first document matching the ID across all types) [[api-explain-0-90]] @@ -678,7 +678,7 @@ client.explain([params, [callback]]) Provides details about a specific document's score in relation to a specific query. It will also tell you if the document matches the specified query. Also check out http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html[percolaters]. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-explain.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-explain.html[the elasticsearch docs] for more about this method. .See how a document is scored against a simple query [source,js] @@ -764,7 +764,7 @@ client.get([params, [callback]]) Get a typed JSON document from the index based on its id. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-get.html[the elasticsearch docs] for more about this method. .Get `/myindex/mytype/1` [source,js] @@ -804,7 +804,7 @@ client.get({ `String` -- The document ID `index`:: `String` -- The name of the index -`[type=_all]`:: +`type`:: `String` -- The type of the document (use `_all` to fetch the first document matching the ID across all types) [[api-getsource-0-90]] @@ -817,7 +817,7 @@ client.getSource([params, [callback]]) Get the source of a document by it's index, type and id. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-get.html[the elasticsearch docs] for more about this method. // no examples @@ -843,7 +843,7 @@ The default method is `GET` and the usual <>. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-index_.html[the elasticsearch docs] for more about this method. .Create or update a document [source,js] @@ -925,7 +925,7 @@ client.indices.analyze([params, [callback]]) Perform the analysis process on a text and return the tokens breakdown of the text. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-analyze.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-analyze.html[the elasticsearch docs] for more about this method. // no examples @@ -960,7 +960,7 @@ client.indices.clearCache([params, [callback]]) Clear either all caches or specific cached associated with one ore more indices. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-clearcache.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-clearcache.html[the elasticsearch docs] for more about this method. // no examples @@ -1001,7 +1001,7 @@ client.indices.close([params, [callback]]) Close an index to remove it's overhead from the cluster. Closed index is blocked for read/write operations. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-open-close.html[the elasticsearch docs] for more about this method. // no examples @@ -1026,7 +1026,7 @@ client.indices.create([params, [callback]]) Create an index in Elasticsearch. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-create-index.html[the elasticsearch docs] for more about this method. // no examples @@ -1051,7 +1051,7 @@ client.indices.delete([params, [callback]]) Delete an index in Elasticsearch -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-index.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-delete-index.html[the elasticsearch docs] for more about this method. // no examples @@ -1076,7 +1076,7 @@ client.indices.deleteAlias([params, [callback]]) Delete a specific alias. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1103,7 +1103,7 @@ client.indices.deleteMapping([params, [callback]]) Delete a mapping (type definition) along with its data. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-mapping.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-delete-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1128,7 +1128,7 @@ client.indices.deleteTemplate([params, [callback]]) Delete an index template by its name. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -1153,7 +1153,7 @@ client.indices.deleteWarmer([params, [callback]]) Delete an index warmer. -The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html[the elasticsearch docs] for more about this method. +The default method is `DELETE` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-warmers.html[the elasticsearch docs] for more about this method. // no examples @@ -1180,7 +1180,7 @@ client.indices.exists([params, [callback]]) Return a boolean indicating whether given index exists. -The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-settings.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-get-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -1201,7 +1201,7 @@ client.indices.existsAlias([params, [callback]]) Return a boolean indicating whether given alias exists. -The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1226,7 +1226,7 @@ client.indices.existsType([params, [callback]]) Check if a type/types exists in an index/indices. -The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-types-exists.html[the elasticsearch docs] for more about this method. +The default method is `HEAD` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-types-exists.html[the elasticsearch docs] for more about this method. // no examples @@ -1251,7 +1251,7 @@ client.indices.flush([params, [callback]]) Explicitly flush one or more indices. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-flush.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-flush.html[the elasticsearch docs] for more about this method. // no examples @@ -1280,7 +1280,7 @@ client.indices.getAlias([params, [callback]]) Retrieve a specified alias. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1305,7 +1305,7 @@ client.indices.getAliases([params, [callback]]) Retrieve specified aliases -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1328,7 +1328,7 @@ client.indices.getFieldMapping([params, [callback]]) Retrieve mapping definition of a specific field. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-get-field-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1355,7 +1355,7 @@ client.indices.getMapping([params, [callback]]) Retrieve mapping definition of index or index/type. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-get-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1378,7 +1378,7 @@ client.indices.getSettings([params, [callback]]) Retrieve settings for one or more (or all) indices. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-get-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1399,7 +1399,7 @@ client.indices.getTemplate([params, [callback]]) Retrieve an index template by its name. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -1420,7 +1420,7 @@ client.indices.getWarmer([params, [callback]]) Retreieve an index warmer. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-warmers.html[the elasticsearch docs] for more about this method. // no examples @@ -1445,7 +1445,7 @@ client.indices.open([params, [callback]]) Open a closed index, making it available for search. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-open-close.html[the elasticsearch docs] for more about this method. // no examples @@ -1470,7 +1470,7 @@ client.indices.optimize([params, [callback]]) Explicitly optimize one or more indices. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-optimize.html[the elasticsearch docs] for more about this method. // no examples @@ -1505,7 +1505,7 @@ client.indices.putAlias([params, [callback]]) Create an alias for a specific index/indices. -The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1532,7 +1532,7 @@ client.indices.putMapping([params, [callback]]) Register specific mapping definition for a specific type. -The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-put-mapping.html[the elasticsearch docs] for more about this method. // no examples @@ -1561,7 +1561,7 @@ client.indices.putSettings([params, [callback]]) Change specific index level settings in real time. -The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-update-settings.html[the elasticsearch docs] for more about this method. // no examples @@ -1584,7 +1584,7 @@ client.indices.putTemplate([params, [callback]]) Create an index template that will automatically be applied to new indices created. -The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-templates.html[the elasticsearch docs] for more about this method. // no examples @@ -1611,7 +1611,7 @@ client.indices.putWarmer([params, [callback]]) Create an index warmer to run registered search requests to warm up the index before it is available for search. -The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html[the elasticsearch docs] for more about this method. +The default method is `PUT` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-warmers.html[the elasticsearch docs] for more about this method. // no examples @@ -1638,7 +1638,7 @@ client.indices.refresh([params, [callback]]) Explicitly refresh one or more index, making all operations performed since the last refresh available for search. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-refresh.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-refresh.html[the elasticsearch docs] for more about this method. // no examples @@ -1663,7 +1663,7 @@ client.indices.segments([params, [callback]]) Retrieve low level segments information that a Lucene index (shard level) is built with. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-segments.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-segments.html[the elasticsearch docs] for more about this method. // no examples @@ -1688,7 +1688,7 @@ client.indices.snapshotIndex([params, [callback]]) Initiate a snapshot through the gateway of one or more indices. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-gateway-snapshot.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-gateway-snapshot.html[the elasticsearch docs] for more about this method. // no examples @@ -1711,7 +1711,7 @@ client.indices.stats([params, [callback]]) Retrieve statistics on different operations happening on an index. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-stats.html[the elasticsearch docs] for more about this method. // no examples @@ -1778,7 +1778,7 @@ client.indices.status([params, [callback]]) Get a comprehensive status information of one or more indices. -The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html[the elasticsearch docs] for more about this method. +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-status.html[the elasticsearch docs] for more about this method. // no examples @@ -1807,7 +1807,7 @@ client.indices.updateAliases([params, [callback]]) Update specified aliases. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html[the elasticsearch docs] for more about this method. // no examples @@ -1832,7 +1832,7 @@ client.indices.validateQuery([params, [callback]]) Validate a potentially expensive query without executing it. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-validate.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-validate.html[the elasticsearch docs] for more about this method. // no examples @@ -1881,7 +1881,7 @@ client.mget([params, [callback]]) Get multiple documents based on an index, type (optional) and ids. The body required by mget can take two forms: an array of document locations, or an array of document ids. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-multi-get.html[the elasticsearch docs] for more about this method. .An array of doc locations. Useful for getting documents from different indices. [source,js] @@ -1946,7 +1946,7 @@ client.mlt([params, [callback]]) (more like this) Gets more documents that are “like” the document specified using `index`, `type`, and `id`. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-more-like-this.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-more-like-this.html[the elasticsearch docs] for more about this method. .Search for similar documents using the `title` property of document `myindex/mytype/1` [source,js] @@ -2020,7 +2020,7 @@ client.msearch([params, [callback]]) Execute several search requests within the same request. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-multi-search.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-multi-search.html[the elasticsearch docs] for more about this method. .Perform multiple different searches, the body is made up of meta/data pairs [source,js] @@ -2059,7 +2059,7 @@ client.percolate([params, [callback]]) Match a document against registered percolator queries. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-percolate.html[the elasticsearch docs] for more about this method. .First, Register queries named “alert-1” and “alert-2” for the “myindex” index [source,js] @@ -2152,7 +2152,7 @@ client.scroll([params, [callback]]) Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a `search()` call. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-request-scroll.html[the elasticsearch docs] for more about this method. .Collect every title in the index that contains the word "test" [source,js] @@ -2207,7 +2207,7 @@ TIP: https://github.com/fullscale/elastic.js[elastic.js] can be used to make bui -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-search.html[the elasticsearch docs] for more about this method. .Search with a simple query string query [source,js] @@ -2306,7 +2306,7 @@ client.search({ `Date, Number` -- Explicit operation timeout `version`:: `Boolean` -- Specify whether to return document version as part of a hit -`[index=_all]`:: +`index`:: `String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices `type`:: `String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types @@ -2321,7 +2321,7 @@ client.suggest([params, [callback]]) The suggest feature suggests similar looking terms based on a provided text by using a specific suggester. -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-search.html[the elasticsearch docs] for more about this method. .Return query terms suggestions (“auto-correction”) [source,js] @@ -2386,7 +2386,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 -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html[the elasticsearch docs] for more about this method. +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-update.html[the elasticsearch docs] for more about this method. .Update document title using partial document [source,js] diff --git a/scripts/generate/aliases.js b/scripts/generate/aliases.js index 41ef5c953..0ed0e7a96 100644 --- a/scripts/generate/aliases.js +++ b/scripts/generate/aliases.js @@ -91,5 +91,8 @@ module.exports = { '/{index}/_stats/indexing', '/{index}/_stats/search/{search_groups}', '/{index}/_stats/fielddata/{fields}' + ], + 'cluster.createSnapshot': [ + '/_snapshot/{repository}/{snapshot}/_create' ] }; \ No newline at end of file diff --git a/scripts/generate/index.js b/scripts/generate/index.js index 083fef33c..a1c1332b1 100644 --- a/scripts/generate/index.js +++ b/scripts/generate/index.js @@ -64,22 +64,27 @@ function spawn(cmd, args) { return proc; } -function generateBranch(branch, i, done) { +function initSubmodule(done) { + spawn('git', ['submodule', 'update', '--init']) + .on('exit', function (status) { + done(status ? new Error('Unable to init submodules.') : void 0); + }); + return; +} + +function fetch(done) { + spawn('git', ['submodule', 'foreach', 'git fetch origin']) + .on('exit', function (status) { + done(status ? new Error('Unable fetch lastest changes.') : void 0); + }); + return; +} + +function generateBranch(branch, done) { async.series([ - function (done) { - if (i === 0) { - spawn('git', ['submodule', 'update', '--init']) - .on('exit', function (status) { - done(status ? new Error('Unable to init submodules.') : void 0); - }); - return; - } - - done(); - }, function (done) { spawn('git', ['submodule', 'foreach', [ - 'git fetch origin master', 'git reset --hard', 'git clean -fdx', 'git checkout origin/' + branch + 'git reset --hard', 'git clean -fdx', 'git checkout origin/' + branch ].join(' && ')]) .on('exit', function (status) { done(status ? new Error('Unable to checkout ' + branch) : void 0); @@ -105,8 +110,10 @@ function generateBranch(branch, i, done) { } async.series([ - async.apply(generateBranch, '0.90', 0), - async.apply(generateBranch, 'master', 1) + initSubmodule, + fetch, + async.apply(generateBranch, '0.90'), + async.apply(generateBranch, 'master') ], function (err) { if (err) { throw err; diff --git a/scripts/generate/js_api.js b/scripts/generate/js_api.js index 222de3b98..6784b565f 100644 --- a/scripts/generate/js_api.js +++ b/scripts/generate/js_api.js @@ -6,6 +6,8 @@ module.exports = function (branch, done) { var _ = require('../../src/lib/utils'); var fs = require('relative-fs').relativeTo(__dirname); var async = require('async'); + var chalk = require('chalk'); + var path = require('path'); var templates = require('./templates'); var castExistsRE = /exists/; var usesBulkBodyRE = /^(bulk|msearch)$/; @@ -26,7 +28,10 @@ module.exports = function (branch, done) { ensureDocsDir, formatDocVars, writeMethodDocs - ], done); + ], function (err) { + console.log(''); + done(err); + }); function readSpecFiles(done) { var apiDir = require('path').join(__dirname, '../../src/elasticsearch/rest-api-spec/api/'); @@ -73,7 +78,7 @@ module.exports = function (branch, done) { function writeApiFile(done) { var outputPath = require('path').join(__dirname, '../../src/lib/api' + branchSuffix + '.js'); fs.writeFileSync(outputPath, templates.apiFile(apiSpec)); - console.log('wrote', apiSpec.actions.length, 'api actions to', outputPath); + console.log(chalk.white.bold('wrote'), apiSpec.actions.length, 'api actions to', outputPath); done(); } @@ -107,10 +112,16 @@ module.exports = function (branch, done) { } function writeMethodDocs(done) { + var filename = path.resolve(__dirname, '../../docs/api_methods' + branchSuffix + '.asciidoc'); fs.writeFile( - '../../docs/api_methods' + branchSuffix + '.asciidoc', + filename, templates.apiMethods(docVars), - done + function (err) { + if (!err) { + console.log(chalk.white.bold('wrote'), branch + ' method docs to', filename); + } + done(err); + } ); } diff --git a/scripts/generate/yaml_tests.js b/scripts/generate/yaml_tests.js index cb5a0a1e9..11718fd77 100644 --- a/scripts/generate/yaml_tests.js +++ b/scripts/generate/yaml_tests.js @@ -5,6 +5,7 @@ module.exports = function (branch, done) { var jsYaml = require('js-yaml'); var fs = require('relative-fs').relativeTo(__dirname); var async = require('async'); + var chalk = require('chalk'); var _ = require('../../src/lib/utils'); var path = require('path'); var tests = {}; // populated in readYamlTests @@ -42,7 +43,7 @@ module.exports = function (branch, done) { function writeYamlTests(done) { var testFile = require('path').resolve(__dirname, '../../test/integration/yaml_suite/yaml_tests' + branchSuffix + '.json'); fs.writeFileSync(testFile, JSON.stringify(tests, null, ' '), 'utf8'); - console.log('wrote YAML tests as JSON to', testFile); + console.log(chalk.white.bold('wrote') + ' YAML tests as JSON to', testFile); done(); } }; \ No newline at end of file diff --git a/src/elasticsearch b/src/elasticsearch index 7166ab6b6..258c49ea2 160000 --- a/src/elasticsearch +++ b/src/elasticsearch @@ -1 +1 @@ -Subproject commit 7166ab6b6f9b7ded3784d84d57c2e846a66fc923 +Subproject commit 258c49ea235e1d30f9679e5921c7bee68a5d6f77 diff --git a/src/lib/api.js b/src/lib/api.js index 0936e56fb..0284ddc1f 100644 --- a/src/lib/api.js +++ b/src/lib/api.js @@ -3,17 +3,18 @@ var ca = require('./client_action'); var api = module.exports = {}; -api._namespaces = ['cluster', 'indices']; +api._namespaces = ['cat', 'cluster', 'indices']; /** - * Perform a [bulk](http://elasticsearch.org/guide/reference/api/bulk/) request + * Perform a [bulk](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation * @param {Boolean} params.refresh - Refresh the index after performing the operation * @param {String} [params.replication=sync] - Explicitely set the replication type - * @param {String} params.type - Default document type for items which don't provide one + * @param {String} params.routing - Specific routing value * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.type - Default document type for items which don't provide one * @param {String} params.index - Default index for items which don't provide one */ api.bulk = ca({ @@ -37,11 +38,14 @@ api.bulk = ca({ 'async' ] }, - type: { + routing: { type: 'string' }, timeout: { type: 'time' + }, + type: { + type: 'string' } }, urls: [ @@ -72,8 +76,382 @@ api.bulk = ca({ method: 'POST' }); +api.cat = function CatNS(transport) { + this.transport = transport; +}; + /** - * Perform a [clearScroll](http://www.elasticsearch.org/guide/reference/api/search/scroll/) request + * Perform a [cat.aliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-aliases.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return + */ +api.cat.prototype.aliases = ca({ + params: { + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cat/aliases/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, + { + fmt: '/_cat/aliases' + } + ] +}); + +/** + * Perform a [cat.allocation](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-allocation.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.bytes - The unit in which to display byte values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information + */ +api.cat.prototype.allocation = ca({ + params: { + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'm', + 'g' + ] + }, + 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.health](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-health.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.health = ca({ + params: { + 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/health' + } +}); + +/** + * Perform a [cat.help](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.help - Return help information + */ +api.cat.prototype.help = ca({ + params: { + help: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat' + } +}); + +/** + * Perform a [cat.indices](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-indices.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.bytes - The unit in which to display byte values + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.indices = ca({ + params: { + bytes: { + type: 'enum', + options: [ + 'b', + 'k', + 'm', + 'g' + ] + }, + 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/indices/<%=index%>', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_cat/indices' + } + ] +}); + +/** + * Perform a [cat.master](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-master.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.master = ca({ + params: { + 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.nodes](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-nodes.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.nodes = ca({ + params: { + local: { + type: 'boolean' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + h: { + type: 'list' + }, + help: { + type: 'boolean', + 'default': false + }, + v: { + type: 'boolean', + 'default': false + } + }, + url: { + fmt: '/_cat/nodes' + } +}); + +/** + * Perform a [cat.pendingTasks](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + */ +api.cat.prototype.pendingTasks = ca({ + params: { + 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.shards](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-shards.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display + * @param {Boolean} params.help - Return help information + * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information + */ +api.cat.prototype.shards = ca({ + params: { + 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 [clearScroll](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.scrollId - A comma-separated list of scroll IDs to clear @@ -96,18 +474,218 @@ api.cluster = function ClusterNS(transport) { }; /** - * Perform a [cluster.getSettings](http://elasticsearch.org/guide/reference/api/admin-cluster-update-settings/) request + * Perform a [cluster.createRepository](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String} params.repository - A repository name + */ +api.cluster.prototype.createRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'string' + } + }, + sortOrder: -1 + }, + method: 'POST' +}); + +/** + * Perform a [cluster.createSnapshot](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.waitForCompletion - Should this request wait until the operation has completed before returning + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.cluster.prototype.createSnapshot = 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' + } + }, + sortOrder: -2 + }, + method: 'POST' +}); + +/** + * Perform a [cluster.deleteRepository](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout + * @param {String, String[], Boolean} params.repository - A comma-separated list of repository names + */ +api.cluster.prototype.deleteRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'list' + } + }, + sortOrder: -1 + }, + method: 'DELETE' +}); + +/** + * Perform a [cluster.deleteSnapshot](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.cluster.prototype.deleteSnapshot = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + req: { + repository: { + type: 'string' + }, + snapshot: { + type: 'string' + } + }, + sortOrder: -2 + }, + method: 'DELETE' +}); + +/** + * Perform a [cluster.getRepository](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.repository - A comma-separated list of repository names + */ +api.cluster.prototype.getRepository = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + urls: [ + { + fmt: '/_snapshot/<%=repository%>', + req: { + repository: { + type: 'list' + } + } + }, + { + fmt: '/_snapshot' + } + ] +}); + +/** + * Perform a [cluster.getSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout */ api.cluster.prototype.getSettings = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' + } + }, url: { fmt: '/_cluster/settings' } }); /** - * Perform a [cluster.health](http://elasticsearch.org/guide/reference/api/admin-cluster-health/) request + * Perform a [cluster.getSnapshot](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {String, String[], Boolean} params.repository - A comma-separated list of repository names + * @param {String, String[], Boolean} params.snapshot - A comma-separated list of snapshot names + */ +api.cluster.prototype.getSnapshot = ca({ + params: { + masterTimeout: { + type: 'time', + name: 'master_timeout' + } + }, + url: { + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + req: { + repository: { + type: 'list' + }, + snapshot: { + type: 'list' + } + }, + sortOrder: -2 + } +}); + +/** + * Perform a [cluster.health](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.level=cluster] - Specify the level of detail for returned information @@ -180,7 +758,7 @@ api.cluster.prototype.health = ca({ }); /** - * Perform a [cluster.nodeHotThreads](http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-hot-threads/) request + * Perform a [cluster.nodeHotThreads](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.interval - The interval for the second sampling of threads @@ -225,64 +803,48 @@ api.cluster.prototype.nodeHotThreads = ca({ }); /** - * Perform a [cluster.nodeInfo](http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-info/) request + * Perform a [cluster.nodeInfo](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-info.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.all - Return all available information - * @param {Boolean} params.clear - Reset the default settings - * @param {Boolean} params.http - Return information about HTTP - * @param {Boolean} params.jvm - Return information about the JVM - * @param {Boolean} params.network - Return information about network - * @param {Boolean} params.os - Return information about the operating system - * @param {Boolean} params.plugin - Return information about plugins - * @param {Boolean} params.process - Return information about the Elasticsearch process - * @param {Boolean} params.settings - Return information about node settings - * @param {Boolean} params.threadPool - Return information about the thread pool - * @param {Date, Number} params.timeout - Explicit operation timeout - * @param {Boolean} params.transport - Return information about transport + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * @param {String, String[], Boolean} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. */ api.cluster.prototype.nodeInfo = ca({ params: { - all: { - type: 'boolean' - }, - clear: { - type: 'boolean' - }, - http: { - type: 'boolean' - }, - jvm: { - type: 'boolean' - }, - network: { - type: 'boolean' - }, - os: { - type: 'boolean' - }, - plugin: { - type: 'boolean' - }, - process: { - type: 'boolean' - }, - settings: { - type: 'boolean' - }, - threadPool: { + flatSettings: { type: 'boolean', - name: 'thread_pool' + name: 'flat_settings' }, - timeout: { - type: 'time' - }, - transport: { - type: 'boolean' + human: { + type: 'boolean', + 'default': false } }, urls: [ + { + fmt: '/_nodes/<%=nodeId%>/<%=metric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + 'settings', + 'os', + 'process', + 'jvm', + 'thread_pool', + 'network', + 'transport', + 'http', + 'plugin' + ] + } + } + }, { fmt: '/_nodes/<%=nodeId%>', req: { @@ -291,6 +853,25 @@ api.cluster.prototype.nodeInfo = ca({ } } }, + { + fmt: '/_nodes/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + 'settings', + 'os', + 'process', + 'jvm', + 'thread_pool', + 'network', + 'transport', + 'http', + 'plugin' + ] + } + } + }, { fmt: '/_nodes' } @@ -298,7 +879,7 @@ api.cluster.prototype.nodeInfo = ca({ }); /** - * Perform a [cluster.nodeShutdown](http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown/) request + * Perform a [cluster.nodeShutdown](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.delay - Set the delay for the operation (default: 1s) @@ -331,66 +912,165 @@ api.cluster.prototype.nodeShutdown = ca({ }); /** - * Perform a [cluster.nodeStats](http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-stats/) request + * Perform a [cluster.nodeStats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.all - Return all available information - * @param {Boolean} params.clear - Reset the default level of detail - * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return detailed information for, when returning the `indices` metric family (supports wildcards) - * @param {Boolean} params.fs - Return information about the filesystem - * @param {Boolean} params.http - Return information about HTTP - * @param {Boolean} params.indices - Return information about indices - * @param {Boolean} params.jvm - Return information about the JVM - * @param {Boolean} params.network - Return information about network - * @param {Boolean} params.os - Return information about the operating system - * @param {Boolean} params.process - Return information about the Elasticsearch process - * @param {Boolean} params.threadPool - Return information about the thread pool - * @param {Boolean} params.transport - Return information about transport - * @param {String} params.metricFamily - Limit the information returned to a certain metric family - * @param {String} params.metric - Limit the information returned for `indices` family to a specific metric + * @param {String, String[], Boolean} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * @param {Boolean} params.groups - A comma-separated list of search groups for `search` index metric + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String} [params.level=node] - Return indices stats aggregated at node, index or shard level + * @param {String, String[], Boolean} params.types - A comma-separated list of document types for the `indexing` index metric + * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics + * @param {String, String[], Boolean} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes */ api.cluster.prototype.nodeStats = ca({ params: { - all: { - type: 'boolean' + completionFields: { + type: 'list', + name: 'completion_fields' }, - clear: { - type: 'boolean' + fielddataFields: { + type: 'list', + name: 'fielddata_fields' }, fields: { type: 'list' }, - fs: { + groups: { type: 'boolean' }, - http: { - type: 'boolean' - }, - indices: { - type: 'boolean' - }, - jvm: { - type: 'boolean' - }, - network: { - type: 'boolean' - }, - os: { - type: 'boolean' - }, - process: { - type: 'boolean' - }, - threadPool: { + human: { type: 'boolean', - name: 'thread_pool' + 'default': false }, - transport: { - type: 'boolean' + level: { + type: 'enum', + 'default': 'node', + options: [ + 'node', + 'indices', + 'shards' + ] + }, + types: { + type: 'list' } }, urls: [ + { + fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'network', + 'os', + 'process', + 'thread_pool', + 'transport' + ] + }, + indexMetric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'filter_cache', + 'flush', + 'get', + 'id_cache', + 'indexing', + 'merge', + 'percolate', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer' + ] + } + } + }, + { + fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', + req: { + nodeId: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'network', + 'os', + 'process', + 'thread_pool', + 'transport' + ] + } + } + }, + { + fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'network', + 'os', + 'process', + 'thread_pool', + 'transport' + ] + }, + indexMetric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'filter_cache', + 'flush', + 'get', + 'id_cache', + 'indexing', + 'merge', + 'percolate', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer' + ] + } + } + }, { fmt: '/_nodes/<%=nodeId%>/stats', req: { @@ -399,6 +1079,27 @@ api.cluster.prototype.nodeStats = ca({ } } }, + { + fmt: '/_nodes/stats/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'breaker', + 'fs', + 'http', + 'indices', + 'jvm', + 'network', + 'os', + 'process', + 'thread_pool', + 'transport' + ] + } + } + }, { fmt: '/_nodes/stats' } @@ -406,11 +1107,29 @@ api.cluster.prototype.nodeStats = ca({ }); /** - * Perform a [cluster.putSettings](http://elasticsearch.org/guide/reference/api/admin-cluster-update-settings/) request + * Perform a [cluster.tasks](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-pending.html) request * * @param {Object} params - An object with parameters used to carry out this action */ +api.cluster.prototype.tasks = ca({ + url: { + fmt: '/_cluster/pending_tasks' + } +}); + +/** + * Perform a [cluster.putSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + */ api.cluster.prototype.putSettings = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + } + }, url: { fmt: '/_cluster/settings' }, @@ -418,11 +1137,13 @@ api.cluster.prototype.putSettings = ca({ }); /** - * Perform a [cluster.reroute](http://elasticsearch.org/guide/reference/api/admin-cluster-reroute/) request + * Perform a [cluster.reroute](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-reroute.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.dryRun - Simulate the operation only and return the resulting state * @param {Boolean} params.filterMetadata - Don't return cluster state metadata (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout */ api.cluster.prototype.reroute = ca({ params: { @@ -433,6 +1154,13 @@ api.cluster.prototype.reroute = ca({ filterMetadata: { type: 'boolean', name: 'filter_metadata' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' } }, url: { @@ -442,59 +1170,143 @@ api.cluster.prototype.reroute = ca({ }); /** - * Perform a [cluster.state](http://elasticsearch.org/guide/reference/api/admin-cluster-state/) request + * Perform a [cluster.restoreSnapshot](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Boolean} params.waitForCompletion - Should this request wait until the operation has completed before returning + * @param {String} params.repository - A repository name + * @param {String} params.snapshot - A snapshot name + */ +api.cluster.prototype.restoreSnapshot = 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' + } + }, + sortOrder: -2 + }, + method: 'POST' +}); + +/** + * Perform a [cluster.state](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-state.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.filterBlocks - Do not return information about blocks - * @param {Boolean} params.filterIndexTemplates - Do not return information about index templates - * @param {String, String[], Boolean} params.filterIndices - Limit returned metadata information to specific indices - * @param {Boolean} params.filterMetadata - Do not return information about indices metadata - * @param {Boolean} params.filterNodes - Do not return information about nodes - * @param {Boolean} params.filterRoutingTable - Do not return information about shard allocation (`routing_table` and `routing_nodes`) * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.metric - Limit the information returned to the specified metrics */ api.cluster.prototype.state = ca({ params: { - filterBlocks: { - type: 'boolean', - name: 'filter_blocks' - }, - filterIndexTemplates: { - type: 'boolean', - name: 'filter_index_templates' - }, - filterIndices: { - type: 'list', - name: 'filter_indices' - }, - filterMetadata: { - type: 'boolean', - name: 'filter_metadata' - }, - filterNodes: { - type: 'boolean', - name: 'filter_nodes' - }, - filterRoutingTable: { - type: 'boolean', - name: 'filter_routing_table' - }, local: { type: 'boolean' }, masterTimeout: { type: 'time', name: 'master_timeout' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' } }, - url: { - fmt: '/_cluster/state' - } + urls: [ + { + fmt: '/_cluster/state/<%=metric%>/<%=index%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'blocks', + 'index_templates', + 'metadata', + 'nodes', + 'routing_table' + ] + }, + index: { + type: 'list' + } + } + }, + { + fmt: '/_cluster/state/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'blocks', + 'index_templates', + 'metadata', + 'nodes', + 'routing_table' + ] + } + } + }, + { + fmt: '/_cluster/state' + } + ] }); /** - * Perform a [count](http://elasticsearch.org/guide/reference/api/count/) request + * Perform a [cluster.stats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-stats.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + */ +api.cluster.prototype.stats = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/_cluster/stats/nodes/<%=nodeId%>', + req: { + nodeId: { + type: 'list' + } + } + }, + { + fmt: '/_cluster/stats' + } + ] +}); + +/** + * Perform a [count](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-count.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -568,7 +1380,7 @@ api.count = ca({ }); /** - * Perform a [delete](http://elasticsearch.org/guide/reference/api/delete/) request + * Perform a [delete](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Specific write consistency setting for the operation @@ -644,7 +1456,7 @@ api['delete'] = ca({ }); /** - * Perform a [deleteByQuery](http://www.elasticsearch.org/guide/reference/api/delete-by-query/) request + * Perform a [deleteByQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.analyzer - The analyzer to use for the query string @@ -750,7 +1562,7 @@ api.deleteByQuery = ca({ }); /** - * Perform a [exists](http://elasticsearch.org/guide/reference/api/get/) request + * Perform a [exists](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.parent - The ID of the parent document @@ -760,7 +1572,7 @@ api.deleteByQuery = ca({ * @param {String} params.routing - Specific routing value * @param {String} params.id - The document ID * @param {String} params.index - The name of the index - * @param {String} [params.type=_all] - The type of the document (use `_all` to fetch the first document matching the ID across all types) + * @param {String} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) */ api.exists = ca({ params: { @@ -782,28 +1594,25 @@ api.exists = ca({ }, url: { fmt: '/<%=index%>/<%=type%>/<%=id%>', - opt: { - type: { - type: 'string', - 'default': '_all' - } - }, req: { index: { type: 'string' }, + type: { + type: 'string' + }, id: { type: 'string' } }, - sortOrder: -2 + sortOrder: -3 }, castExists: true, method: 'HEAD' }); /** - * Perform a [explain](http://elasticsearch.org/guide/reference/api/explain/) request + * Perform a [explain](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-explain.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) @@ -902,7 +1711,7 @@ api.explain = ca({ }); /** - * Perform a [get](http://elasticsearch.org/guide/reference/api/get/) request + * Perform a [get](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response @@ -914,9 +1723,11 @@ api.explain = ca({ * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type * @param {String} params.id - The document ID * @param {String} params.index - The name of the index - * @param {String} [params.type=_all] - The type of the document (use `_all` to fetch the first document matching the ID across all types) + * @param {String} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) */ api.get = ca({ params: { @@ -948,30 +1759,38 @@ api.get = ca({ _sourceInclude: { type: 'list', name: '_source_include' + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external' + ], + name: 'version_type' } }, url: { fmt: '/<%=index%>/<%=type%>/<%=id%>', - opt: { - type: { - type: 'string', - 'default': '_all' - } - }, req: { index: { type: 'string' }, + type: { + type: 'string' + }, id: { type: 'string' } }, - sortOrder: -2 + sortOrder: -3 } }); /** - * Perform a [getSource](http://elasticsearch.org/guide/reference/api/get/) request + * Perform a [getSource](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.exclude - A list of fields to exclude from the returned _source field @@ -981,9 +1800,14 @@ api.get = ca({ * @param {Boolean} params.realtime - Specify whether to perform the operation in realtime or search mode * @param {Boolean} params.refresh - Refresh the shard containing the document before performing the operation * @param {String} params.routing - Specific routing value + * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return + * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field + * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type * @param {String} params.id - The document ID * @param {String} params.index - The name of the index - * @param {String} [params.type=_all] - The type of the document; use `_all` to fetch the first document matching the ID across all types + * @param {String} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types */ api.getSource = ca({ params: { @@ -1007,36 +1831,54 @@ api.getSource = ca({ }, 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' + ], + name: 'version_type' } }, url: { fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - opt: { - type: { - type: 'string', - 'default': '_all' - } - }, req: { index: { type: 'string' }, + type: { + type: 'string' + }, id: { type: 'string' } }, - sortOrder: -2 + sortOrder: -3 } }); /** - * Perform a [index](http://elasticsearch.org/guide/reference/api/index_/) request + * Perform a [index](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation * @param {String} [params.opType=index] - Explicit operation type * @param {String} params.parent - ID of the parent document - * @param {String} params.percolate - Percolator queries to execute while indexing the document * @param {Boolean} params.refresh - Refresh the index after performing the operation * @param {String} [params.replication=sync] - Specific replication type * @param {String} params.routing - Specific routing value @@ -1071,9 +1913,6 @@ api.index = ca({ parent: { type: 'string' }, - percolate: { - type: 'string' - }, refresh: { type: 'boolean' }, @@ -1144,7 +1983,7 @@ api.indices = function IndicesNS(transport) { }; /** - * Perform a [indices.analyze](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze/) request + * Perform a [indices.analyze](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-analyze.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.analyzer - The name of the analyzer to use @@ -1206,7 +2045,7 @@ api.indices.prototype.analyze = ca({ }); /** - * Perform a [indices.clearCache](http://www.elasticsearch.org/guide/reference/api/admin-indices-clearcache/) request + * Perform a [indices.clearCache](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-clearcache.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.fieldData - Clear field data @@ -1294,7 +2133,7 @@ api.indices.prototype.clearCache = ca({ }); /** - * Perform a [indices.close](http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close/) request + * Perform a [indices.close](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1331,20 +2170,24 @@ api.indices.prototype.close = ca({ name: 'expand_wildcards' } }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/_close', + req: { + index: { + type: 'string' + } } }, - sortOrder: -1 - }, + { + fmt: '/_close' + } + ], method: 'POST' }); /** - * Perform a [indices.create](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index/) request + * Perform a [indices.create](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1374,12 +2217,12 @@ api.indices.prototype.create = ca({ }); /** - * Perform a [indices.delete](http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-index/) request + * Perform a [indices.delete](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master - * @param {String, String[], Boolean} params.index - A comma-separated list of indices to delete; use `_all` or empty string to delete all indices + * @param {String, String[], Boolean} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices */ api.indices.prototype['delete'] = ca({ params: { @@ -1408,13 +2251,13 @@ api.indices.prototype['delete'] = ca({ }); /** - * Perform a [indices.deleteAlias](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request + * Perform a [indices.deleteAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit timestamp for the document * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master - * @param {String} params.index - The name of the index with an alias - * @param {String} params.name - The name of the alias to be deleted + * @param {String, String[], Boolean} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices + * @param {String, String[], Boolean} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. */ api.indices.prototype.deleteAlias = ca({ params: { @@ -1430,10 +2273,10 @@ api.indices.prototype.deleteAlias = ca({ fmt: '/<%=index%>/_alias/<%=name%>', req: { index: { - type: 'string' + type: 'list' }, name: { - type: 'string' + type: 'list' } }, sortOrder: -2 @@ -1442,12 +2285,12 @@ api.indices.prototype.deleteAlias = ca({ }); /** - * Perform a [indices.deleteMapping](http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-mapping/) request + * Perform a [indices.deleteMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master - * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` for all indices - * @param {String} params.type - The name of the document type to delete + * @param {String, String[], Boolean} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to delete (supports wildcards); use `_all` to delete all document types in the specified indices. */ api.indices.prototype.deleteMapping = ca({ params: { @@ -1463,7 +2306,7 @@ api.indices.prototype.deleteMapping = ca({ type: 'list' }, type: { - type: 'string' + type: 'list' } }, sortOrder: -2 @@ -1472,7 +2315,7 @@ api.indices.prototype.deleteMapping = ca({ }); /** - * Perform a [indices.deleteTemplate](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/) request + * Perform a [indices.deleteTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1502,53 +2345,40 @@ api.indices.prototype.deleteTemplate = ca({ }); /** - * Perform a [indices.deleteWarmer](http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/) request + * Perform a [indices.deleteWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master - * @param {String, String[], Boolean} params.index - A comma-separated list of index names to register warmer for; use `_all` or empty string to perform the operation on all indices - * @param {String} params.name - The name of the warmer (supports wildcards); leave empty to delete all warmers - * @param {String, String[], Boolean} params.type - A comma-separated list of document types to register warmer for; use `_all` or empty string to perform the operation on all types + * @param {String, String[], Boolean} params.name - A comma-separated list of warmer names to delete (supports wildcards); use `_all` to delete all warmers in the specified indices. You must specify a name either in the uri or in the parameters. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to delete warmers from (supports wildcards); use `_all` to perform the operation on all indices. */ api.indices.prototype.deleteWarmer = ca({ params: { masterTimeout: { type: 'time', name: 'master_timeout' + }, + name: { + type: 'list' } }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - name: { - type: 'string' - } + url: { + fmt: '/<%=index%>/_warmer/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' } }, - { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - } - ], + sortOrder: -2 + }, method: 'DELETE' }); /** - * Perform a [indices.exists](http://www.elasticsearch.org/guide/reference/api/admin-indices-indices-exists/) request + * Perform a [indices.exists](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -1590,7 +2420,7 @@ api.indices.prototype.exists = ca({ }); /** - * Perform a [indices.existsAlias](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request + * Perform a [indices.existsAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -1656,7 +2486,27 @@ api.indices.prototype.existsAlias = ca({ }); /** - * Perform a [indices.existsType](http://www.elasticsearch.org/guide/reference/api/admin-indices-types-exists/) request + * Perform a [indices.existsTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {String} params.name - The name of the template + */ +api.indices.prototype.existsTemplate = ca({ + url: { + fmt: '/_template/<%=name%>', + req: { + name: { + type: 'string' + } + }, + sortOrder: -1 + }, + castExists: true, + method: 'HEAD' +}); + +/** + * Perform a [indices.existsType](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-types-exists.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -1702,7 +2552,7 @@ api.indices.prototype.existsType = ca({ }); /** - * Perform a [indices.flush](http://www.elasticsearch.org/guide/reference/api/admin-indices-flush/) request + * Perform a [indices.flush](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-flush.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) @@ -1710,7 +2560,6 @@ api.indices.prototype.existsType = ca({ * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {Boolean} params.refresh - Refresh the index after performing the operation * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices */ api.indices.prototype.flush = ca({ @@ -1737,9 +2586,6 @@ api.indices.prototype.flush = ca({ 'closed' ], name: 'expand_wildcards' - }, - refresh: { - type: 'boolean' } }, urls: [ @@ -1759,7 +2605,7 @@ api.indices.prototype.flush = ca({ }); /** - * Perform a [indices.getAlias](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request + * Perform a [indices.getAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -1815,16 +2661,20 @@ api.indices.prototype.getAlias = ca({ type: 'list' } } + }, + { + fmt: '/_alias' } ] }); /** - * Perform a [indices.getAliases](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request + * Perform a [indices.getAliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout * @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases + * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to filter */ api.indices.prototype.getAliases = ca({ params: { @@ -1833,6 +2683,17 @@ api.indices.prototype.getAliases = ca({ } }, urls: [ + { + fmt: '/<%=index%>/_aliases/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'list' + } + } + }, { fmt: '/<%=index%>/_aliases', req: { @@ -1841,6 +2702,14 @@ api.indices.prototype.getAliases = ca({ } } }, + { + fmt: '/_aliases/<%=name%>', + req: { + name: { + type: 'list' + } + } + }, { fmt: '/_aliases' } @@ -1855,6 +2724,7 @@ api.indices.prototype.getAliases = ca({ * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {String, String[], Boolean} params.index - A comma-separated list of index names * @param {String, String[], Boolean} params.type - A comma-separated list of document types * @param {String, String[], Boolean} params.field - A comma-separated list of fields @@ -1881,11 +2751,14 @@ api.indices.prototype.getFieldMapping = ca({ 'closed' ], name: 'expand_wildcards' + }, + local: { + type: 'boolean' } }, urls: [ { - fmt: '/<%=index%>/<%=type%>/_mapping/field/<%=field%>', + fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=field%>', req: { index: { type: 'list' @@ -1909,6 +2782,17 @@ api.indices.prototype.getFieldMapping = ca({ } } }, + { + fmt: '/_mapping/<%=type%>/field/<%=field%>', + req: { + type: { + type: 'list' + }, + field: { + type: 'list' + } + } + }, { fmt: '/_mapping/field/<%=field%>', req: { @@ -1921,12 +2805,13 @@ api.indices.prototype.getFieldMapping = ca({ }); /** - * Perform a [indices.getMapping](http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping/) request + * Perform a [indices.getMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {String, String[], Boolean} params.index - A comma-separated list of index names * @param {String, String[], Boolean} params.type - A comma-separated list of document types */ @@ -1948,11 +2833,14 @@ api.indices.prototype.getMapping = ca({ 'closed' ], name: 'expand_wildcards' + }, + local: { + type: 'boolean' } }, urls: [ { - fmt: '/<%=index%>/<%=type%>/_mapping', + fmt: '/<%=index%>/_mapping/<%=type%>', req: { index: { type: 'list' @@ -1970,6 +2858,14 @@ api.indices.prototype.getMapping = ca({ } } }, + { + fmt: '/_mapping/<%=type%>', + req: { + type: { + type: 'list' + } + } + }, { fmt: '/_mapping' } @@ -1977,13 +2873,59 @@ api.indices.prototype.getMapping = ca({ }); /** - * Perform a [indices.getSettings](http://www.elasticsearch.org/guide/reference/api/admin-indices-get-settings/) request + * Perform a [indices.getSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {String} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {String} params.prefix - The prefix all settings must have in order to be included + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {String} 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' + ], + name: 'expand_wildcards' + }, + prefix: { + type: 'string' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' + } + }, urls: [ + { + fmt: '/<%=index%>/_settings/<%=name%>', + req: { + index: { + type: 'list' + }, + name: { + type: 'string' + } + } + }, { fmt: '/<%=index%>/_settings', req: { @@ -1992,6 +2934,14 @@ api.indices.prototype.getSettings = ca({ } } }, + { + fmt: '/_settings/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, { fmt: '/_settings' } @@ -1999,12 +2949,19 @@ api.indices.prototype.getSettings = ca({ }); /** - * Perform a [indices.getTemplate](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/) request + * Perform a [indices.getTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) * @param {String} params.name - The name of the template */ api.indices.prototype.getTemplate = ca({ + params: { + flatSettings: { + type: 'boolean', + name: 'flat_settings' + } + }, urls: [ { fmt: '/_template/<%=name%>', @@ -2021,7 +2978,7 @@ api.indices.prototype.getTemplate = ca({ }); /** - * Perform a [indices.getWarmer](http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/) request + * Perform a [indices.getWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -2084,12 +3041,23 @@ api.indices.prototype.getWarmer = ca({ type: 'list' } } + }, + { + fmt: '/_warmer/<%=name%>', + req: { + name: { + type: 'string' + } + } + }, + { + fmt: '/_warmer' } ] }); /** - * Perform a [indices.open](http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close/) request + * Perform a [indices.open](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -2126,20 +3094,24 @@ api.indices.prototype.open = ca({ name: 'expand_wildcards' } }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/_open', + req: { + index: { + type: 'string' + } } }, - sortOrder: -1 - }, + { + fmt: '/_open' + } + ], method: 'POST' }); /** - * Perform a [indices.optimize](http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize/) request + * Perform a [indices.optimize](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.flush - Specify whether the index should be flushed after performing the operation (default: true) @@ -2149,7 +3121,6 @@ api.indices.prototype.open = ca({ * @param {Number} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) * @param {Boolean} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents * @param {Anything} params.operationThreading - TODO: ? - * @param {Boolean} params.refresh - Specify whether the index should be refreshed after performing the operation (default: true) * @param {Boolean} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ @@ -2186,9 +3157,6 @@ api.indices.prototype.optimize = ca({ operationThreading: { name: 'operation_threading' }, - refresh: { - type: 'boolean' - }, waitForMerge: { type: 'boolean', name: 'wait_for_merge' @@ -2211,12 +3179,12 @@ api.indices.prototype.optimize = ca({ }); /** - * Perform a [indices.putAlias](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request + * Perform a [indices.putAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit timestamp for the document * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master - * @param {String} params.index - The name of the index with an alias + * @param {String, String[], Boolean} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` or omit to perform the operation on all indices. * @param {String} params.name - The name of the alias to be created or updated */ api.indices.prototype.putAlias = ca({ @@ -2234,7 +3202,7 @@ api.indices.prototype.putAlias = ca({ fmt: '/<%=index%>/_alias/<%=name%>', req: { index: { - type: 'string' + type: 'list' }, name: { type: 'string' @@ -2248,24 +3216,13 @@ api.indices.prototype.putAlias = ca({ type: 'string' } } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_alias' } ], method: 'PUT' }); /** - * Perform a [indices.putMapping](http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping/) request + * Perform a [indices.putMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreConflicts - Specify whether to ignore conflicts while updating the mapping (default: false) @@ -2274,7 +3231,7 @@ api.indices.prototype.putAlias = ca({ * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` to perform the operation on all indices + * @param {String, String[], Boolean} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. * @param {String} params.type - The name of the document type */ api.indices.prototype.putMapping = ca({ @@ -2308,17 +3265,39 @@ api.indices.prototype.putMapping = ca({ name: 'expand_wildcards' } }, + urls: [ + { + fmt: '/<%=index%>/_mapping/<%=type%>', + req: { + index: { + type: 'list' + }, + type: { + type: 'string' + } + } + }, + { + fmt: '/_mapping/<%=type%>', + req: { + type: { + type: 'string' + } + } + } + ], method: 'PUT' }); /** - * Perform a [indices.putSettings](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/) request + * Perform a [indices.putSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ api.indices.prototype.putSettings = ca({ @@ -2343,6 +3322,10 @@ api.indices.prototype.putSettings = ca({ 'closed' ], name: 'expand_wildcards' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' } }, urls: [ @@ -2362,12 +3345,13 @@ api.indices.prototype.putSettings = ca({ }); /** - * Perform a [indices.putTemplate](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/) request + * Perform a [indices.putTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Number} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master + * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) * @param {String} params.name - The name of the template */ api.indices.prototype.putTemplate = ca({ @@ -2381,6 +3365,10 @@ api.indices.prototype.putTemplate = ca({ masterTimeout: { type: 'time', name: 'master_timeout' + }, + flatSettings: { + type: 'boolean', + name: 'flat_settings' } }, url: { @@ -2396,14 +3384,14 @@ api.indices.prototype.putTemplate = ca({ }); /** - * Perform a [indices.putWarmer](http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/) request + * Perform a [indices.putWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) in the search request to warm * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices in the search request to warm. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both, in the search request to warm. - * @param {String, String[], Boolean} params.index - A comma-separated list of index names to register the warmer for; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to register the warmer for; use `_all` or omit to perform the operation on all indices * @param {String} params.name - The name of the warmer * @param {String, String[], Boolean} params.type - A comma-separated list of document types to register the warmer for; leave empty to perform the operation on all types */ @@ -2456,18 +3444,27 @@ api.indices.prototype.putWarmer = ca({ type: 'string' } } + }, + { + fmt: '/_warmer/<%=name%>', + req: { + name: { + type: 'string' + } + } } ], method: 'PUT' }); /** - * Perform a [indices.refresh](http://www.elasticsearch.org/guide/reference/api/admin-indices-refresh/) request + * Perform a [indices.refresh](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-refresh.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.force - Force a refresh even if not required * @param {Anything} params.operationThreading - TODO: ? * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ @@ -2490,6 +3487,10 @@ api.indices.prototype.refresh = ca({ ], name: 'expand_wildcards' }, + force: { + type: 'boolean', + 'default': false + }, operationThreading: { name: 'operation_threading' } @@ -2511,12 +3512,13 @@ api.indices.prototype.refresh = ca({ }); /** - * Perform a [indices.segments](http://elasticsearch.org/guide/reference/api/admin-indices-segments/) request + * Perform a [indices.segments](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-segments.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. * @param {Anything} params.operationThreading - TODO: ? * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ @@ -2539,6 +3541,10 @@ api.indices.prototype.segments = ca({ ], name: 'expand_wildcards' }, + human: { + type: 'boolean', + 'default': false + }, operationThreading: { name: 'operation_threading' } @@ -2559,7 +3565,7 @@ api.indices.prototype.segments = ca({ }); /** - * Perform a [indices.snapshotIndex](http://www.elasticsearch.org/guide/reference/api/admin-indices-gateway-snapshot/) request + * Perform a [indices.snapshotIndex](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-gateway-snapshot.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -2604,57 +3610,25 @@ api.indices.prototype.snapshotIndex = ca({ }); /** - * Perform a [indices.stats](http://elasticsearch.org/guide/reference/api/admin-indices-stats/) request + * Perform a [indices.stats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.all - Return all available information - * @param {Boolean} params.clear - Reset the default level of detail - * @param {Boolean} params.completion - Return information about completion suggester stats - * @param {String, String[], Boolean} params.completionFields - A comma-separated list of fields for `completion` metric (supports wildcards) - * @param {Boolean} params.docs - Return information about indexed and deleted documents - * @param {Boolean} params.fielddata - Return information about field data - * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields for `fielddata` metric (supports wildcards) - * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return detailed information for, when returning the `search` statistics - * @param {Boolean} params.filterCache - Return information about filter cache - * @param {Boolean} params.flush - Return information about flush operations - * @param {Boolean} params.get - Return information about get operations - * @param {Boolean} params.groups - A comma-separated list of search groups for `search` statistics - * @param {Boolean} params.idCache - Return information about ID cache - * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {Boolean} params.indexing - Return information about indexing operations - * @param {Boolean} params.merge - Return information about merge operations - * @param {Boolean} params.refresh - Return information about refresh operations - * @param {Boolean} params.search - Return information about search operations; use the `groups` parameter to include information for specific search groups - * @param {Boolean} params.store - Return information about the size of the index - * @param {Boolean} params.warmer - Return information about warmers + * @param {String, String[], Boolean} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * @param {String, String[], Boolean} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * @param {Boolean} params.groups - A comma-separated list of search groups for `search` index metric + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String} [params.level=indices] - Return stats aggregated at cluster, index or shard level + * @param {String, String[], Boolean} params.types - A comma-separated list of document types for the `indexing` index metric * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {String, String[], Boolean} params.indexingTypes - A comma-separated list of document types to include in the `indexing` statistics - * @param {String} params.metricFamily - Limit the information returned to a specific metric - * @param {String, String[], Boolean} params.searchGroups - A comma-separated list of search groups to include in the `search` statistics + * @param {String, String[], Boolean} params.metric - Limit the information returned the specific metrics. */ api.indices.prototype.stats = ca({ params: { - all: { - type: 'boolean' - }, - clear: { - type: 'boolean' - }, - completion: { - type: 'boolean' - }, completionFields: { type: 'list', name: 'completion_fields' }, - docs: { - type: 'boolean' - }, - fielddata: { - type: 'boolean' - }, fielddataFields: { type: 'list', name: 'fielddata_fields' @@ -2662,60 +3636,82 @@ api.indices.prototype.stats = ca({ fields: { type: 'list' }, - filterCache: { - type: 'boolean', - name: 'filter_cache' - }, - flush: { - type: 'boolean' - }, - get: { - type: 'boolean' - }, groups: { type: 'boolean' }, - idCache: { + human: { type: 'boolean', - name: 'id_cache' + 'default': false }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { + level: { type: 'enum', - 'default': 'open', + 'default': 'indices', options: [ - 'open', - 'closed' - ], - name: 'expand_wildcards' + 'cluster', + 'indices', + 'shards' + ] }, - indexing: { - type: 'boolean' - }, - merge: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - search: { - type: 'boolean' - }, - store: { - type: 'boolean' - }, - warmer: { - type: 'boolean' + types: { + type: 'list' } }, urls: [ + { + fmt: '/<%=index%>/_stats/<%=metric%>', + req: { + index: { + type: 'list' + }, + metric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'filter_cache', + 'flush', + 'get', + 'id_cache', + 'indexing', + 'merge', + 'percolate', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer' + ] + } + } + }, + { + fmt: '/_stats/<%=metric%>', + req: { + metric: { + type: 'list', + options: [ + '_all', + 'completion', + 'docs', + 'fielddata', + 'filter_cache', + 'flush', + 'get', + 'id_cache', + 'indexing', + 'merge', + 'percolate', + 'refresh', + 'search', + 'segments', + 'store', + 'warmer' + ] + } + } + }, { fmt: '/<%=index%>/_stats', req: { @@ -2731,12 +3727,13 @@ api.indices.prototype.stats = ca({ }); /** - * Perform a [indices.status](http://elasticsearch.org/guide/reference/api/admin-indices-status/) request + * Perform a [indices.status](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * @param {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. * @param {Anything} params.operationThreading - TODO: ? * @param {Boolean} params.recovery - Return information about shard recovery * @param {Boolean} params.snapshot - TODO: ? @@ -2761,6 +3758,10 @@ api.indices.prototype.status = ca({ ], name: 'expand_wildcards' }, + human: { + type: 'boolean', + 'default': false + }, operationThreading: { name: 'operation_threading' }, @@ -2787,7 +3788,7 @@ api.indices.prototype.status = ca({ }); /** - * Perform a [indices.updateAliases](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request + * Perform a [indices.updateAliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Request timeout @@ -2811,7 +3812,7 @@ api.indices.prototype.updateAliases = ca({ }); /** - * Perform a [indices.validateQuery](http://www.elasticsearch.org/guide/reference/api/validate/) request + * Perform a [indices.validateQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-validate.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.explain - Return detailed information about the error @@ -2884,7 +3885,7 @@ api.indices.prototype.validateQuery = ca({ }); /** - * Perform a [info](http://elasticsearch.org/guide/) request + * Perform a [info](http://www.elasticsearch.org/guide/) request * * @param {Object} params - An object with parameters used to carry out this action */ @@ -2895,7 +3896,7 @@ api.info = ca({ }); /** - * Perform a [mget](http://elasticsearch.org/guide/reference/api/multi-get/) request + * Perform a [mget](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response @@ -2962,16 +3963,16 @@ api.mget = ca({ }); /** - * Perform a [mlt](http://elasticsearch.org/guide/reference/api/more-like-this/) request + * Perform a [mlt](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-more-like-this.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Number} params.boostTerms - The boost factor * @param {Number} params.maxDocFreq - The word occurrence frequency as count: words with higher occurrence in the corpus will be ignored * @param {Number} params.maxQueryTerms - The maximum query terms to be included in the generated query - * @param {Number} params.maxWordLen - The minimum length of the word: longer words will be ignored + * @param {Number} params.maxWordLength - The minimum length of the word: longer words will be ignored * @param {Number} params.minDocFreq - The word occurrence frequency as count: words with lower occurrence in the corpus will be ignored * @param {Number} params.minTermFreq - The term frequency as percent: terms with lower occurence in the source document will be ignored - * @param {Number} params.minWordLen - The minimum length of the word: shorter words will be ignored + * @param {Number} params.minWordLength - The minimum length of the word: shorter words will be ignored * @param {String, String[], Boolean} params.mltFields - Specific fields to perform the query against * @param {Number} params.percentTermsToMatch - How many terms have to match in order to consider the document a match (default: 0.3) * @param {String} params.routing - Specific routing value @@ -3002,9 +4003,9 @@ api.mlt = ca({ type: 'number', name: 'max_query_terms' }, - maxWordLen: { + maxWordLength: { type: 'number', - name: 'max_word_len' + name: 'max_word_length' }, minDocFreq: { type: 'number', @@ -3014,9 +4015,9 @@ api.mlt = ca({ type: 'number', name: 'min_term_freq' }, - minWordLen: { + minWordLength: { type: 'number', - name: 'min_word_len' + name: 'min_word_length' }, mltFields: { type: 'list', @@ -3085,7 +4086,7 @@ api.mlt = ca({ }); /** - * Perform a [msearch](http://www.elasticsearch.org/guide/reference/api/multi-search/) request + * Perform a [msearch](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.searchType - Search operation type @@ -3136,7 +4137,7 @@ api.msearch = ca({ }); /** - * Perform a [percolate](http://elasticsearch.org/guide/reference/api/percolate/) request + * Perform a [percolate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) @@ -3166,7 +4167,19 @@ api.percolate = ca({ }); /** - * Perform a [scroll](http://www.elasticsearch.org/guide/reference/api/search/scroll/) request + * Perform a [ping](http://www.elasticsearch.org/guide/) request + * + * @param {Object} params - An object with parameters used to carry out this action + */ +api.ping = ca({ + url: { + fmt: '/' + }, + method: 'HEAD' +}); + +/** + * Perform a [scroll](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search @@ -3199,7 +4212,7 @@ api.scroll = ca({ }); /** - * Perform a [search](http://www.elasticsearch.org/guide/reference/api/search/) request + * Perform a [search](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.analyzer - The analyzer to use for the query string @@ -3233,7 +4246,7 @@ api.scroll = ca({ * @param {Text} params.suggestText - The source text for which the suggestions should be returned * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Boolean} params.version - Specify whether to return document version as part of a hit - * @param {String, String[], Boolean} [params.index=_all] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ api.search = ca({ @@ -3373,36 +4386,32 @@ api.search = ca({ urls: [ { fmt: '/<%=index%>/<%=type%>/_search', - opt: { - index: { - type: 'list', - 'default': '_all' - } - }, req: { + index: { + type: 'list' + }, type: { type: 'list' } } }, - { - fmt: '/_search' - }, { fmt: '/<%=index%>/_search', - opt: { + req: { index: { - type: 'list', - 'default': '_all' + type: 'list' } } + }, + { + fmt: '/_search' } ], method: 'POST' }); /** - * Perform a [suggest](http://elasticsearch.org/guide/reference/api/search/suggest/) request + * Perform a [suggest](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3459,14 +4468,13 @@ api.suggest = ca({ }); /** - * Perform a [update](http://elasticsearch.org/guide/reference/api/update/) request + * Perform a [update](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response * @param {String} params.lang - The script language (default: mvel) * @param {String} params.parent - ID of the parent document - * @param {String} params.percolate - Perform percolation during the operation; use specific registered query name, attribute, or wildcard * @param {Boolean} params.refresh - Refresh the index after performing the operation * @param {String} [params.replication=sync] - Specific replication type * @param {Number} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) @@ -3500,9 +4508,6 @@ api.update = ca({ parent: { type: 'string' }, - percolate: { - type: 'string' - }, refresh: { type: 'boolean' }, @@ -3562,7 +4567,7 @@ api.update = ca({ }); /** - * Perform a [create](http://elasticsearch.org/guide/reference/api/index_/) request + * Perform a [create](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation diff --git a/src/lib/api_0_90.js b/src/lib/api_0_90.js index baf2605e2..0fd470ac2 100644 --- a/src/lib/api_0_90.js +++ b/src/lib/api_0_90.js @@ -6,7 +6,7 @@ var api = module.exports = {}; api._namespaces = ['cluster', 'indices']; /** - * Perform a [bulk](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html) request + * Perform a [bulk](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-bulk.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation @@ -73,7 +73,7 @@ api.bulk = ca({ }); /** - * Perform a [clearScroll](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html) request + * Perform a [clearScroll](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.scrollId - A comma-separated list of scroll IDs to clear @@ -96,7 +96,7 @@ api.cluster = function ClusterNS(transport) { }; /** - * Perform a [cluster.getSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html) request + * Perform a [cluster.getSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action */ @@ -107,7 +107,7 @@ api.cluster.prototype.getSettings = ca({ }); /** - * Perform a [cluster.health](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html) request + * Perform a [cluster.health](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-health.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.level=cluster] - Specify the level of detail for returned information @@ -180,7 +180,7 @@ api.cluster.prototype.health = ca({ }); /** - * Perform a [cluster.nodeHotThreads](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html) request + * Perform a [cluster.nodeHotThreads](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-nodes-hot-threads.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.interval - The interval for the second sampling of threads @@ -225,7 +225,7 @@ api.cluster.prototype.nodeHotThreads = ca({ }); /** - * Perform a [cluster.nodeInfo](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-info.html) request + * Perform a [cluster.nodeInfo](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-nodes-info.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.all - Return all available information @@ -298,7 +298,7 @@ api.cluster.prototype.nodeInfo = ca({ }); /** - * Perform a [cluster.nodeShutdown](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html) request + * Perform a [cluster.nodeShutdown](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-nodes-shutdown.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.delay - Set the delay for the operation (default: 1s) @@ -331,7 +331,7 @@ api.cluster.prototype.nodeShutdown = ca({ }); /** - * Perform a [cluster.nodeStats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html) request + * Perform a [cluster.nodeStats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-nodes-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.all - Return all available information @@ -406,7 +406,7 @@ api.cluster.prototype.nodeStats = ca({ }); /** - * Perform a [cluster.putSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html) request + * Perform a [cluster.putSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action */ @@ -418,7 +418,7 @@ api.cluster.prototype.putSettings = ca({ }); /** - * Perform a [cluster.reroute](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-reroute.html) request + * Perform a [cluster.reroute](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-reroute.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.dryRun - Simulate the operation only and return the resulting state @@ -442,7 +442,7 @@ api.cluster.prototype.reroute = ca({ }); /** - * Perform a [cluster.state](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-state.html) request + * Perform a [cluster.state](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/cluster-state.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.filterBlocks - Do not return information about blocks @@ -494,7 +494,7 @@ api.cluster.prototype.state = ca({ }); /** - * Perform a [count](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-count.html) request + * Perform a [count](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-count.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -558,7 +558,7 @@ api.count = ca({ }); /** - * Perform a [delete](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html) request + * Perform a [delete](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-delete.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Specific write consistency setting for the operation @@ -634,7 +634,7 @@ api['delete'] = ca({ }); /** - * Perform a [deleteByQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) request + * Perform a [deleteByQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-delete-by-query.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.analyzer - The analyzer to use for the query string @@ -730,7 +730,7 @@ api.deleteByQuery = ca({ }); /** - * Perform a [exists](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html) request + * Perform a [exists](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.parent - The ID of the parent document @@ -740,7 +740,7 @@ api.deleteByQuery = ca({ * @param {String} params.routing - Specific routing value * @param {String} params.id - The document ID * @param {String} params.index - The name of the index - * @param {String} [params.type=_all] - The type of the document (use `_all` to fetch the first document matching the ID across all types) + * @param {String} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) */ api.exists = ca({ params: { @@ -762,28 +762,25 @@ api.exists = ca({ }, url: { fmt: '/<%=index%>/<%=type%>/<%=id%>', - opt: { - type: { - type: 'string', - 'default': '_all' - } - }, req: { index: { type: 'string' }, + type: { + type: 'string' + }, id: { type: 'string' } }, - sortOrder: -2 + sortOrder: -3 }, castExists: true, method: 'HEAD' }); /** - * Perform a [explain](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-explain.html) request + * Perform a [explain](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-explain.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) @@ -882,7 +879,7 @@ api.explain = ca({ }); /** - * Perform a [get](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html) request + * Perform a [get](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response @@ -896,7 +893,7 @@ api.explain = ca({ * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field * @param {String} params.id - The document ID * @param {String} params.index - The name of the index - * @param {String} [params.type=_all] - The type of the document (use `_all` to fetch the first document matching the ID across all types) + * @param {String} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) */ api.get = ca({ params: { @@ -932,26 +929,23 @@ api.get = ca({ }, url: { fmt: '/<%=index%>/<%=type%>/<%=id%>', - opt: { - type: { - type: 'string', - 'default': '_all' - } - }, req: { index: { type: 'string' }, + type: { + type: 'string' + }, id: { type: 'string' } }, - sortOrder: -2 + sortOrder: -3 } }); /** - * Perform a [getSource](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html) request + * Perform a [getSource](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.exclude - A list of fields to exclude from the returned _source field @@ -963,7 +957,7 @@ api.get = ca({ * @param {String} params.routing - Specific routing value * @param {String} params.id - The document ID * @param {String} params.index - The name of the index - * @param {String} [params.type=_all] - The type of the document; use `_all` to fetch the first document matching the ID across all types + * @param {String} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types */ api.getSource = ca({ params: { @@ -991,26 +985,23 @@ api.getSource = ca({ }, url: { fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - opt: { - type: { - type: 'string', - 'default': '_all' - } - }, req: { index: { type: 'string' }, + type: { + type: 'string' + }, id: { type: 'string' } }, - sortOrder: -2 + sortOrder: -3 } }); /** - * Perform a [index](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html) request + * Perform a [index](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation @@ -1124,7 +1115,7 @@ api.indices = function IndicesNS(transport) { }; /** - * Perform a [indices.analyze](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-analyze.html) request + * Perform a [indices.analyze](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-analyze.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.analyzer - The name of the analyzer to use @@ -1186,7 +1177,7 @@ api.indices.prototype.analyze = ca({ }); /** - * Perform a [indices.clearCache](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-clearcache.html) request + * Perform a [indices.clearCache](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-clearcache.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.fieldData - Clear field data @@ -1264,7 +1255,7 @@ api.indices.prototype.clearCache = ca({ }); /** - * Perform a [indices.close](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html) request + * Perform a [indices.close](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1294,7 +1285,7 @@ api.indices.prototype.close = ca({ }); /** - * Perform a [indices.create](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html) request + * Perform a [indices.create](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-create-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1324,7 +1315,7 @@ api.indices.prototype.create = ca({ }); /** - * Perform a [indices.delete](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-index.html) request + * Perform a [indices.delete](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-delete-index.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1358,7 +1349,7 @@ api.indices.prototype['delete'] = ca({ }); /** - * Perform a [indices.deleteAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request + * Perform a [indices.deleteAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit timestamp for the document @@ -1392,7 +1383,7 @@ api.indices.prototype.deleteAlias = ca({ }); /** - * Perform a [indices.deleteMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-mapping.html) request + * Perform a [indices.deleteMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-delete-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master @@ -1422,7 +1413,7 @@ api.indices.prototype.deleteMapping = ca({ }); /** - * Perform a [indices.deleteTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html) request + * Perform a [indices.deleteTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1452,7 +1443,7 @@ api.indices.prototype.deleteTemplate = ca({ }); /** - * Perform a [indices.deleteWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html) request + * Perform a [indices.deleteWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-warmers.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master @@ -1506,7 +1497,7 @@ api.indices.prototype.deleteWarmer = ca({ }); /** - * Perform a [indices.exists](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-settings.html) request + * Perform a [indices.exists](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-get-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.index - A comma-separated list of indices to check @@ -1526,7 +1517,7 @@ api.indices.prototype.exists = ca({ }); /** - * Perform a [indices.existsAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request + * Perform a [indices.existsAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -1571,7 +1562,7 @@ api.indices.prototype.existsAlias = ca({ }); /** - * Perform a [indices.existsType](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-types-exists.html) request + * Perform a [indices.existsType](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-types-exists.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -1607,7 +1598,7 @@ api.indices.prototype.existsType = ca({ }); /** - * Perform a [indices.flush](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-flush.html) request + * Perform a [indices.flush](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-flush.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) @@ -1654,7 +1645,7 @@ api.indices.prototype.flush = ca({ }); /** - * Perform a [indices.getAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request + * Perform a [indices.getAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -1697,7 +1688,7 @@ api.indices.prototype.getAlias = ca({ }); /** - * Perform a [indices.getAliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request + * Perform a [indices.getAliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1725,7 +1716,7 @@ api.indices.prototype.getAliases = ca({ }); /** - * Perform a [indices.getFieldMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html) request + * Perform a [indices.getFieldMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-get-field-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.includeDefaults - Whether the default mapping values should be returned as well @@ -1778,7 +1769,7 @@ api.indices.prototype.getFieldMapping = ca({ }); /** - * Perform a [indices.getMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html) request + * Perform a [indices.getMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-get-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.index - A comma-separated list of index names @@ -1812,7 +1803,7 @@ api.indices.prototype.getMapping = ca({ }); /** - * Perform a [indices.getSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html) request + * Perform a [indices.getSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-get-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1834,7 +1825,7 @@ api.indices.prototype.getSettings = ca({ }); /** - * Perform a [indices.getTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html) request + * Perform a [indices.getTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.name - The name of the template @@ -1856,7 +1847,7 @@ api.indices.prototype.getTemplate = ca({ }); /** - * Perform a [indices.getWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html) request + * Perform a [indices.getWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-warmers.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.index - A comma-separated list of index names to restrict the operation; use `_all` to perform the operation on all indices @@ -1902,7 +1893,7 @@ api.indices.prototype.getWarmer = ca({ }); /** - * Perform a [indices.open](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html) request + * Perform a [indices.open](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-open-close.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit operation timeout @@ -1932,7 +1923,7 @@ api.indices.prototype.open = ca({ }); /** - * Perform a [indices.optimize](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html) request + * Perform a [indices.optimize](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-optimize.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.flush - Specify whether the index should be flushed after performing the operation (default: true) @@ -1994,7 +1985,7 @@ api.indices.prototype.optimize = ca({ }); /** - * Perform a [indices.putAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request + * Perform a [indices.putAlias](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Explicit timestamp for the document @@ -2048,7 +2039,7 @@ api.indices.prototype.putAlias = ca({ }); /** - * Perform a [indices.putMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html) request + * Perform a [indices.putMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-put-mapping.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.ignoreConflicts - Specify whether to ignore conflicts while updating the mapping (default: false) @@ -2087,7 +2078,7 @@ api.indices.prototype.putMapping = ca({ }); /** - * Perform a [indices.putSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html) request + * Perform a [indices.putSettings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-update-settings.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master @@ -2117,7 +2108,7 @@ api.indices.prototype.putSettings = ca({ }); /** - * Perform a [indices.putTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html) request + * Perform a [indices.putTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-templates.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Number} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) @@ -2151,7 +2142,7 @@ api.indices.prototype.putTemplate = ca({ }); /** - * Perform a [indices.putWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html) request + * Perform a [indices.putWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-warmers.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.masterTimeout - Specify timeout for connection to master @@ -2197,7 +2188,7 @@ api.indices.prototype.putWarmer = ca({ }); /** - * Perform a [indices.refresh](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-refresh.html) request + * Perform a [indices.refresh](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-refresh.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -2236,7 +2227,7 @@ api.indices.prototype.refresh = ca({ }); /** - * Perform a [indices.segments](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-segments.html) request + * Perform a [indices.segments](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-segments.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -2274,7 +2265,7 @@ api.indices.prototype.segments = ca({ }); /** - * Perform a [indices.snapshotIndex](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-gateway-snapshot.html) request + * Perform a [indices.snapshotIndex](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-gateway-snapshot.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -2309,7 +2300,7 @@ api.indices.prototype.snapshotIndex = ca({ }); /** - * Perform a [indices.stats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html) request + * Perform a [indices.stats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-stats.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.all - Return all available information @@ -2426,7 +2417,7 @@ api.indices.prototype.stats = ca({ }); /** - * Perform a [indices.status](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html) request + * Perform a [indices.status](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-status.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -2472,7 +2463,7 @@ api.indices.prototype.status = ca({ }); /** - * Perform a [indices.updateAliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html) request + * Perform a [indices.updateAliases](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Date, Number} params.timeout - Request timeout @@ -2496,7 +2487,7 @@ api.indices.prototype.updateAliases = ca({ }); /** - * Perform a [indices.validateQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-validate.html) request + * Perform a [indices.validateQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-validate.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.explain - Return detailed information about the error @@ -2570,7 +2561,7 @@ api.info = ca({ }); /** - * Perform a [mget](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html) request + * Perform a [mget](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-multi-get.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return in the response @@ -2637,7 +2628,7 @@ api.mget = ca({ }); /** - * Perform a [mlt](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-more-like-this.html) request + * Perform a [mlt](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-more-like-this.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Number} params.boostTerms - The boost factor @@ -2760,7 +2751,7 @@ api.mlt = ca({ }); /** - * Perform a [msearch](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-multi-search.html) request + * Perform a [msearch](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-multi-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.searchType - Search operation type @@ -2811,7 +2802,7 @@ api.msearch = ca({ }); /** - * Perform a [percolate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html) request + * Perform a [percolate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-percolate.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) @@ -2841,7 +2832,7 @@ api.percolate = ca({ }); /** - * Perform a [scroll](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html) request + * Perform a [scroll](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-request-scroll.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {Duration} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search @@ -2874,7 +2865,7 @@ api.scroll = ca({ }); /** - * Perform a [search](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html) request + * Perform a [search](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.analyzer - The analyzer to use for the query string @@ -2906,7 +2897,7 @@ api.scroll = ca({ * @param {Text} params.suggestText - The source text for which the suggestions should be returned * @param {Date, Number} params.timeout - Explicit operation timeout * @param {Boolean} params.version - Specify whether to return document version as part of a hit - * @param {String, String[], Boolean} [params.index=_all] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types */ api.search = ca({ @@ -3038,13 +3029,10 @@ api.search = ca({ urls: [ { fmt: '/<%=index%>/<%=type%>/_search', - opt: { - index: { - type: 'list', - 'default': '_all' - } - }, req: { + index: { + type: 'list' + }, type: { type: 'list' } @@ -3052,10 +3040,9 @@ api.search = ca({ }, { fmt: '/<%=index%>/_search', - opt: { + req: { index: { - type: 'list', - 'default': '_all' + type: 'list' } } } @@ -3064,7 +3051,7 @@ api.search = ca({ }); /** - * Perform a [suggest](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html) request + * Perform a [suggest](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-search.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones @@ -3111,7 +3098,7 @@ api.suggest = ca({ }); /** - * Perform a [update](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html) request + * Perform a [update](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-update.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation @@ -3214,7 +3201,7 @@ api.update = ca({ }); /** - * Perform a [create](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html) request + * Perform a [create](http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-index_.html) request * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.consistency - Explicit write consistency setting for the operation diff --git a/test/integration/yaml_suite/client_manager.js b/test/integration/yaml_suite/client_manager.js index 2ab45965b..43815c3f5 100644 --- a/test/integration/yaml_suite/client_manager.js +++ b/test/integration/yaml_suite/client_manager.js @@ -54,18 +54,20 @@ module.exports = { cb = options, options = {}; } - var logConfig = _.has(options, 'logConfig') - ? options.logConfig - : { - type: BROWSER - ? 'console' - : VERBOSE - ? 'tracer' - : 'stdio', - level: VERBOSE - ? 'trace' - : 'warning' - }; + var logConfig = {}; + if (_.has(options, 'logConfig')) { + logConfig = options.logConfig; + } else { + if (BROWSER) { + logConfig.type = 'console'; + } else if (JENKINS || !VERBOSE) { + logConfig.type = 'stdio'; + } else { + logConfig.type = 'tracer'; + } + + logConfig.level = VERBOSE ? 'trace' : 'error'; + } if (logConfig && logConfig.type === 'tracer') { try { diff --git a/test/integration/yaml_suite/yaml_doc.js b/test/integration/yaml_suite/yaml_doc.js index 1830eaa50..a63c307f7 100644 --- a/test/integration/yaml_suite/yaml_doc.js +++ b/test/integration/yaml_suite/yaml_doc.js @@ -135,15 +135,19 @@ function YamlDoc(doc, file) { if (err) { err.message += ' in ' + action.name; } - done(err); + process.nextTick(function () { + done(err); + }); }); } else { try { action.bound(); - done(); + process.nextTick(done); } catch (err) { err.message += ' in ' + action.name; - done(err); + process.nextTick(function () { + done(err); + }); } } };