Reputation: 131
I am using ES 6.x. I created a field 'abc' and currently I have 10 records in my Index. I want to update a value '1' to all the records at single time. What will be the preferred approach.
Upvotes: 0
Views: 456
Reputation: 2006
You can use Update by Query API. Here is the example:
POST my_index/my_type/_update_by_query
{
"script": {
"source": "ctx._source.my_field = '1'",
"lang": "painless"
}
}
Upvotes: 1