Merge branch '2.0' of github.com:elasticsearch/elasticsearch-js

This commit is contained in:
Spencer Alger
2014-03-27 13:41:22 -07:00
6 changed files with 18 additions and 6 deletions

View File

@ -3,6 +3,7 @@
## 2.0 (Mar 27 2014)
- The default API version is now `'1.0'`
- Promises are now supported using the Bluebird module.
- If you try to reuse a configuration object, an error will be thrown. https://github.com/elasticsearch/elasticsearch-js/issues/33
## 1.5 (Feb 6 2014)
- Switched out `keepaliveagent` dependency with `forever-agent`, which is used in the ever popular `request` module, and is much simpler.
@ -11,6 +12,7 @@
- Fixed a bug that caused invalid param/type errors to not be reported properly, in the browser builds that use promises.
- added the cat.threadPool to the master/1.0/1.x apis
- Enabled Basic auth in the Angular connector -- Thanks @jeff-french!
- Fixed a bug that was preventing index requests (and any other POST/PUT request) from using connections in the connection pool.
## 1.4 (Jan 30 2014)
- The trace log messages will now diaplay the actual host connected to (without auth info) unless they are being written to a bash script

View File

@ -34,7 +34,7 @@ bower install elasticsearch
```
### Download
- v1.5.8: [zip](https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-1.5.8.zip), [tar.gz](https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-1.5.8.tar.gz)
- v2.0.0: [zip](https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.0.0.zip), [tar.gz](https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.0.0.tar.gz)
## Docs
- [Quick Start](http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/quick-start.html)
@ -48,7 +48,7 @@ bower install elasticsearch
[Jenkins](https://build.elasticsearch.org/job/es-js_nightly/)
Elasticsearch.js provides support for, and is regularly tested against, Elasticsearch releases **0.90.5 and greater**. We also test against the latest changes in the 0.90 and master branches of the Elasticsearch repository. To tell the client which version of Elastisearch you are using, and therefore the API it should provide, set the `apiVerson` config param. [More info](http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/configuration.html#_config_options)
Elasticsearch.js provides support for, and is regularly tested against, Elasticsearch releases **0.90.5 and greater**. We also test against the latest changes in the 0.90 and master branches of the Elasticsearch repository. To tell the client which version of Elastisearch you are using, and therefore the API it should provide, set the `apiVersion` config param. [More info](http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/configuration.html#_config_options)
## Examples

View File

@ -29,7 +29,7 @@ bower install elasticsearch
---------
==== Download
* v1.5.8: https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-1.5.8.zip[zip], https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-1.5.8.tar.gz[tar.gz]
* v2.0.0: https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.0.0.zip[zip], https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.0.0.tar.gz[tar.gz]
==== Angular Build (elasticsearch.angular.js)

View File

@ -1,16 +1,19 @@
[[configuration]]
== Configuration
The `Client` constructor accepts a single object as it's argument, and the following keys can be used to configure that client instance.
The `Client` constructor accepts a single object as it's argument. In the <<config-options>> section all of the available options/keys are listed.
[source,js]
------
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
...
... config options ...
});
------
WARNING: Due to the complex nature of the configuration, the config object you pass in will be modified and can only be used to create one `Client` instance. Sorry for the inconvenience. Related Github issue: https://github.com/elasticsearch/elasticsearch-js/issues/33
[[config-options]]
=== Config options
[horizontal]
`host or hosts`[[config-hosts]]::

View File

@ -7,7 +7,7 @@
"description": "The official low-level Elasticsearch client for Node.js and the browser.",
"main": "src/elasticsearch.js",
"homepage": "http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/index.html",
"version": "1.5.8",
"version": "2.0.0",
"browser": {
"./src/lib/connectors/index.js": "./src/lib/connectors/browser_index.js",
"./src/lib/loggers/index.js": "./src/lib/loggers/browser_index.js",

View File

@ -32,6 +32,13 @@ var _ = require('./utils');
function Client(config) {
config = config || {};
if (config.__reused) {
throw new Error('Do not reuse objects to configure the elasticsearch Client class: ' +
'https://github.com/elasticsearch/elasticsearch-js/issues/33');
} else {
config.__reused = true;
}
function EsApiClient() {
// our client will log minimally by default
if (!config.hasOwnProperty('log')) {