Hormigas
Hormigas

Reputation: 1449

retry_on_conflict in Jest ElasticSearch

Is it possible to somehow set the retry_on_conflict parameter while using Update.Builder in Jest ?

I'm trying to set the parameter but am clueless about how I would add this to my request.

Could I somehow add it to the "script" field as demonstrated in https://github.com/searchbox-io/Jest/tree/master/jest in the Updating Documents section ? That works too.

Upvotes: 0

Views: 1474

Answers (1)

JH Berthemet
JH Berthemet

Reputation: 46

Here is how it can be done:

Update update = new Update.Builder(payload)
  .index(aliasName)
  .type(typeName)
  .id(docId)
  .setParameter("retry_on_conflict", 5)
  .build();

Upvotes: 3

Related Questions