Commit Graph

31 Commits

Author SHA1 Message Date
01ab682fb7 Handle bulk errors in examples 2019-04-01 09:09:10 +02:00
b11e7ffc9f Generated reference 2019-03-29 18:09:00 +01:00
352a2c3652 Docs: Set the stack version to 6.7 2019-03-29 11:23:53 -04:00
5ce9f55481 Generated reference 2019-03-29 15:47:32 +01:00
baac03846e Update asciidoc config 2019-03-29 15:42:24 +01:00
41050f23f5 Generated reference 2019-03-29 08:52:44 +01:00
2daa6d35c6 Docs: Fix the API reference (#799) 2019-03-29 08:52:18 +01:00
45744762d3 Fix docs (#796)
Follow up of https://github.com/elastic/docs/pull/701.
2019-03-28 17:36:52 +01:00
8f131d5a6d API generation 2019-03-27 07:50:42 +01:00
81e09a71c2 Regenerate doc 2019-03-27 07:47:03 +01:00
41fa164611 Doc updates (#791)
Updates for better displaying the documentation in the website.
2019-03-27 07:46:03 +01:00
d5256e2fc1 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:55:35 +01:00
0b739ea23c regenerated typings and reference 2019-03-13 16:11:14 +01:00
3396b5d818 Updated docs 2019-03-12 12:04:13 +01:00
dc27cb11ed Updated docs 2019-03-12 10:50:58 +01:00
6eb4f874cc Updated docs 2019-03-11 18:37:29 +01:00
45c31df5c1 Updated docs 2019-03-11 17:15:39 +01:00
945fe1f605 Updated docs 2019-02-28 10:57:59 +01:00
a56327058b Updated docs 2019-02-21 15:39:15 +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
8ff4cdc506 Updated docs 2019-02-19 12:34:08 +01:00
f01ccf0ff3 Fix syntax 2019-02-19 11:12:02 +01:00
8fd0d49a03 Updated docs 2019-02-19 09:34:23 +01:00
7616e88438 Updated docs 2019-02-19 08:37:07 +01:00
51ac759167 Updated docs 2019-02-15 18:36:28 +01:00
f704d4fcf3 Added examples 2019-02-14 18:34:20 +01:00
1c2dbf6e76 Added examples 2019-02-14 16:25:16 +01:00
9bbae42ccc Docs: Fix typo and added a note 2019-02-14 16:25:03 +01:00
6d68d22e32 Added API reference 2019-02-14 07:57:29 +01:00
8cd8dd3410 Updated docs indentation and added more examples 2019-02-13 07:51:39 +01:00
d4b2d4676b Added docs 2019-02-12 16:40:33 +01:00