// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:409

[source, python]
----
resp = client.update_by_query(
    index="my-index-000001",
    script={
        "source": "ctx._source.count++",
        "lang": "painless"
    },
    query={
        "term": {
            "user.id": "kimchy"
        }
    },
)
print(resp)
----
