1

I'd like to use the bulk update api with a script, but i would like to apply the update via a query- and not an id.

A standard bulk-update payload looks something like this-

{
  "_index": "users",
  "_type": "user",
  "_op_type": "update",
  "_id": "123",
  "script": { ... }
}

But i'd like to instead replace the _id property with a query-

{
  "_index": "users",
  "_type": "user",
  "_op_type": "update",
  "_query": {"query": {"range": {"age": {"gte": 30}}}},
  "script": { ... }
}

Is this possible with the bulk update api? Do I need to run this as a standard update via script api request?

1 Answer 1

1

I don't think this is possible with bulk API. What I think you really need is update_by_query method. For more details, check examples in the documentation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.