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:
committed by
delvedor
parent
2debb7ba64
commit
796644fc0c
7
lib/Transport.d.ts
vendored
7
lib/Transport.d.ts
vendored
@ -80,9 +80,9 @@ declare type anyObject = {
|
||||
export interface TransportRequestParams {
|
||||
method: string;
|
||||
path: string;
|
||||
body?: anyObject,
|
||||
bulkBody?: anyObject,
|
||||
querystring: anyObject
|
||||
body?: anyObject;
|
||||
bulkBody?: anyObject;
|
||||
querystring?: anyObject;
|
||||
}
|
||||
|
||||
export interface TransportRequestOptions {
|
||||
@ -91,6 +91,7 @@ export interface TransportRequestOptions {
|
||||
maxRetries?: number;
|
||||
asStream?: boolean;
|
||||
headers?: anyObject;
|
||||
querystring?: anyObject;
|
||||
compression?: string;
|
||||
warnings?: [string];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user