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)
```
This commit is contained in:
Tomas Della Vedova
2019-03-15 18:09:44 +01:00
committed by delvedor
parent 55fd03942f
commit d5256e2fc1
261 changed files with 1051 additions and 6 deletions

View File

@ -159,6 +159,10 @@ _Default:_ `false`
|`headers`
|`object` - Custom headers for the request. +
_Default:_ `null`
|`querystring`
|`object` - Custom querystring for the request. +
_Default:_ `null`
|===
=== Error handling