Commit Graph

1467 Commits

Author SHA1 Message Date
c0027b3958 Added a note about the new client 2019-03-19 09:53:43 +01:00
68c4dd29fb feat: add support for querystring in options object (#779)
In very few cases, some API uses the same key for both url and query params, such as the bulk method.
The client is not designed to handle such cases since accepts both url and query keys in the same object, and the url parameter will always take precedence.
This pr fixes this edge case by adding a `querystring` key in the options object.

Fixes: https://github.com/elastic/elasticsearch-js/pull/778

```js
client.bulk({
  index: 'index',
  type: '_doc',
  body: [...]
}, {
  querystring: {
    type: '_doc'
  }
}, console.log)
```
2019-03-19 09:53:43 +01:00
a3e3d57247 Updated coverage script 2019-03-15 17:49:24 +01:00
c3966cacab Added codecov badge 2019-03-15 17:49:24 +01:00
048933f106 Updated ignore files 2019-03-15 17:49:24 +01:00
91935905b6 Added codecov (#777) 2019-03-15 17:49:24 +01:00
0f5ac8127c Updated README 2019-03-14 18:33:22 +01:00
99e1dc3b39 API generation 2019-03-13 14:13:53 +01:00
e98cab1a34 Revert d4d7d0bef5 2019-03-13 14:13:32 +01:00
4663738cf4 Merge branch 'next' 2019-03-13 13:35:45 +01:00
6b69e17b21 Clean master 2019-03-13 13:35:34 +01:00
a713e28853 WIP: benchmarks (#745)
* Updated dependencies

* Updated .gitignore

* WIP: macro and micro benchmarks

* Updated benchmark suite

* Use the same suite for both macro and micro benchmarks

* WIP: benchmark report

* Updated benchmark suite

* Updated docker scripts

* Updated benchmark suite

* Updated scripts

* Updated benchmark suite

* Added split2
2019-03-12 16:45:49 +01:00
3396b5d818 Updated docs 2019-03-12 12:04:13 +01:00
dc27cb11ed Updated docs 2019-03-12 10:50:58 +01:00
40023c53a7 Bumped v0.1.0-beta.2 2019-03-12 10:14:00 +01:00
69fd7768f2 Updated dependencies 2019-03-12 10:13:39 +01:00
d4d7d0bef5 Updated code generation 2019-03-11 18:37:33 +01:00
6eb4f874cc Updated docs 2019-03-11 18:37:29 +01:00
5c6c5dea78 API generation 2019-03-11 18:34:39 +01:00
45c31df5c1 Updated docs 2019-03-11 17:15:39 +01:00
ae028b2ae2 Consistency for the win
- The result object contains also the metadata about the request
- The events emits the same object of the API response
- The errors, where possible, exposes the APi response object under the
meta key
2019-03-11 17:13:02 +01:00
c990ed43d4 Updated test 2019-03-11 17:12:53 +01:00
46df19fd7d Updated types 2019-03-11 17:12:31 +01:00
cae38e6b2b License (#773)
- Added license header
- Added license checker
- Fixed tap
2019-03-08 07:47:24 +01:00
4f02fd5509 Bumped v0.1.0-beta.1 2019-03-01 14:56:09 +01:00
f175f83d34 Workaround for keepAlive false 2019-03-01 09:02:31 +01:00
ed3cca0fe6 Platinum integration test (#772)
🎉
2019-03-01 08:42:56 +01:00
36163f4822 Use a safe default for keep alive maxSockets (#770) 2019-02-28 16:08:14 +01:00
945fe1f605 Updated docs 2019-02-28 10:57:59 +01:00
fe3c48e83e Updated test 2019-02-28 10:57:48 +01:00
8398ae2f4b Updated Elastic Cloud config 2019-02-28 10:57:42 +01:00
a56327058b Updated docs 2019-02-21 15:39:15 +01:00
d9b2a969d6 Updated test 2019-02-21 15:39:10 +01:00
7e318cb334 Enable compression for both request and response when using Elastic Cloud 2019-02-21 15:39:01 +01:00
5b856cd4c2 Child client support (#768)
With this pr we introduce the `client.child` API, which returns a new client instance that shares the connection pool with the parent client.
This feature can be handy if you need to have multiple client instances with different configurations, but with a shared connection pool.

Example:

```js
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const child = client.child({
  headers: { 'x-foo': 'bar' },
  requestTimeout: 1000
})

client.info(console.log)
child.info(console.log)
```

**Open questions:**

* Currently, the event emitter is shared between the parent and the child(ren), is it ok?
* Currently, if you extend the parent client, the child client will have the same extensions, while if the child client adds an extension, the parent client will not be extended. Is it ok?

**Caveats:**

* You can override _any_ option except for the connection pool specific options (`ssl`, `agent`, `pingTimeout`, `Connection`, and `resurrectStrategy`).
* You can't specify a new `Connection` class.
* If you call `close` in any of the parent/child clients, every client will be closed.

_Note: the `nodeFilter` and `nodeSelector` options are now `Transport` options and no longer `ConnectionPool` options._
2019-02-21 12:48:49 +01:00
66e8d61476 Updated test 2019-02-20 12:43:15 +01:00
974bf0a819 Added global headers option 2019-02-20 12:43:06 +01:00
e9cc0324c2 Updated scripts 2019-02-19 13:59:27 +01:00
8ff4cdc506 Updated docs 2019-02-19 12:34:08 +01:00
f01ccf0ff3 Fix syntax 2019-02-19 11:12:02 +01:00
36627e66da Bumped v0.1.0-alpha.7 2019-02-19 10:38:21 +01:00
8fd0d49a03 Updated docs 2019-02-19 09:34:23 +01:00
a8f861c4d4 Updated test 2019-02-19 09:34:14 +01:00
665ea3999d Updated types 2019-02-19 09:33:59 +01:00
0915c8c613 Added force option to extend method 2019-02-19 09:33:25 +01:00
7616e88438 Updated docs 2019-02-19 08:37:07 +01:00
b10ec1fa70 Added .npmignore 2019-02-19 08:34:06 +01:00
bcf895294b Updated test 2019-02-19 08:34:06 +01:00
98e8bbd63d Added cloud option and disable dead/alive handling if there is only one node and sniffing is disabled 2019-02-19 08:34:06 +01:00
59a84216b1 Updated .gitignore 2019-02-19 08:34:06 +01:00