# How can we update multiple documents using callwithrequest

**URL:** <https://discuss.elastic.co/t/how-can-we-update-multiple-documents-using-callwithrequest/187578>\
**Category:** Kibana\
**Created:** [June 26, 2019, 1:34pm UTC](https://discuss.elastic.co/t/how-can-we-update-multiple-documents-using-callwithrequest/187578 "2019-06-26T13:34:51Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [June 30, 2019, 3:14am UTC](https://discuss.elastic.co/t/how-can-we-update-multiple-documents-using-callwithrequest/187578/4 "2019-06-30T03:14:21Z")

</div>

l don't know if this is what you are looking for but this will update fields and their values throughout your indexes or index.

```
  POST logstash-*/_update_by_query
    {
      "script": {
        "source": "ctx._source.type='ChangeMeOld'",
        "lang": "painless"
      },
      "query": {
        "term": {
          "type.keyword": "changeMeNEW"
        }
      }
    }
```

---

_[View the full topic](https://discuss.elastic.co/t/how-can-we-update-multiple-documents-using-callwithrequest/187578)._
