# How to update query on multiple indexes

**URL:** <https://discuss.elastic.co/t/how-to-update-query-on-multiple-indexes/294724>\
**Category:** Elasticsearch\
**Created:** [January 18, 2022, 5:58pm UTC](https://discuss.elastic.co/t/how-to-update-query-on-multiple-indexes/294724 "2022-01-18T17:58:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pk5859](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@pk5859](https://discuss.elastic.co/u/pk5859)\
**Post date:** [January 18, 2022, 5:58pm UTC](https://discuss.elastic.co/t/how-to-update-query-on-multiple-indexes/294724/1 "2022-01-18T17:58:54Z")

</div>

I have 3 indexes A, B & C i want to update on all three indexes.  
However python client.update() syntax won't allow it.

\_index="A","B","C"  
query = {"doc": {"cluster":"1" }}  
client.update(index=\_index, id=id, body=query)

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [January 18, 2022, 7:55pm UTC](https://discuss.elastic.co/t/how-to-update-query-on-multiple-indexes/294724/2 "2022-01-18T19:55:08Z")

</div>

I haven't used the client but I would try a string with comma separated values.

`_index="A,B,C"`

---

<div class="post-metadata">

**Author:** ![pk5859](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@pk5859](https://discuss.elastic.co/u/pk5859)\
**Post date:** [January 19, 2022, 4:37am UTC](https://discuss.elastic.co/t/how-to-update-query-on-multiple-indexes/294724/3 "2022-01-19T04:37:55Z")

</div>

I have tried below on kibana dashboard as well but no luck.

1. 

```auto
POST /A,B,C/_update/<id>
{
    "doc" : {
        "new_field" : 111
    }
}

error : "reason" : "Invalid index name [A,B,C], must not contain the following characters [, \", *, \\, <, |, ,, >, /, ?]",

```

1. 

```auto
POST /pass/dl/pan/_update/<id>
{
    "doc" : {
        "new_field" : 111
    }
}
error : "error" : "no handler found for uri [/A/B/C/_update/<id>?pretty=true] and method [POST]"

```

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [January 19, 2022, 12:08pm UTC](https://discuss.elastic.co/t/how-to-update-query-on-multiple-indexes/294724/4 "2022-01-19T12:08:49Z")

</div>

You might need to do separate calls then to update each index at a time. I know you can do a `GET` on a comma separated index but it looks like you can't do a `POST`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 16, 2022, 12:08pm UTC](https://discuss.elastic.co/t/how-to-update-query-on-multiple-indexes/294724/5 "2022-02-16T12:08:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
