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 GitHub
parent 851e839c70
commit c53c798899
261 changed files with 380 additions and 6 deletions

View File

@ -128,7 +128,9 @@ The supported *request specific options* are:
requestTimeout: number, // client default
maxRetries: number, // default `5`
asStream: boolean, // default `false`
headers: object // default `null`
compression: string, // default `false`
headers: object, // default `null`
querystring: object // default `null`
}
```