Drop support for body param in helpers and tests (#2521)
* Update tests and bulk helper to stop using body param * Update compatible-with content-type header for 9.0
This commit is contained in:
@ -383,9 +383,9 @@ export default class Client extends API {
|
||||
maxResponseSize: options.maxResponseSize,
|
||||
maxCompressedResponseSize: options.maxCompressedResponseSize,
|
||||
vendoredHeaders: {
|
||||
jsonContentType: 'application/vnd.elasticsearch+json; compatible-with=8',
|
||||
ndjsonContentType: 'application/vnd.elasticsearch+x-ndjson; compatible-with=8',
|
||||
accept: 'application/vnd.elasticsearch+json; compatible-with=8,text/plain'
|
||||
jsonContentType: 'application/vnd.elasticsearch+json; compatible-with=9',
|
||||
ndjsonContentType: 'application/vnd.elasticsearch+x-ndjson; compatible-with=9',
|
||||
accept: 'application/vnd.elasticsearch+json; compatible-with=9,text/plain'
|
||||
},
|
||||
redaction: options.redaction
|
||||
})
|
||||
|
||||
@ -910,7 +910,7 @@ export default class Helpers {
|
||||
|
||||
function tryBulk (bulkBody: string[], callback: (err: Error | null, bulkBody: string[]) => void): void {
|
||||
if (shouldAbort) return callback(null, [])
|
||||
client.bulk(Object.assign({}, bulkOptions, { body: bulkBody }), reqOptions as TransportRequestOptionsWithMeta)
|
||||
client.bulk(Object.assign({}, bulkOptions, { operations: bulkBody }), reqOptions as TransportRequestOptionsWithMeta)
|
||||
.then(response => {
|
||||
const result = response.body
|
||||
const results = zipBulkResults(result.items, bulkBody)
|
||||
|
||||
Reference in New Issue
Block a user