How to set the retry on conflict in Elastic search using client.bulk method

0

I am using client.bulk method to insert into elastic search. I need to pass the retry_on_conflict param in client.bulk as per the document.

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html

Below code I was trying, but get the error.

const options = {
            index: config.aws.es.index,
            body: bulkBody,
            retry_on_conflict: 5
           // retryOnCflict: 5 (Tried this also) 
        };
        
        
        client.bulk(options, (err, { body }) => {
            if (err) {
                reject(err);
            } else {
                // console.log('ES bulk result: %j', body);
                resolve(body);
            }
        });

Error :

warnings: [
'Client - Unknown parameter: "retryOnConflict", sending it as query parameter'
],

Any one help me that how to add the retry_on_conflict in client.bulk().

amazon-elasticsearch elasticsearch
2021-11-23 18:40:48
1

1

Add retry_on_conflict in body of the bulk request as shown here

2021-11-24 01:04:43

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................