# \_update\_by\_query updating just 1 batch (1000) docs

**URL:** <https://discuss.elastic.co/t/update-by-query-updating-just-1-batch-1000-docs/104678>\
**Category:** Elasticsearch\
**Created:** [October 20, 2017, 9:02am UTC](https://discuss.elastic.co/t/update-by-query-updating-just-1-batch-1000-docs/104678 "2017-10-20T09:02:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dashiad](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@dashiad](https://discuss.elastic.co/u/dashiad)\
**Post date:** [October 20, 2017, 9:02am UTC](https://discuss.elastic.co/t/update-by-query-updating-just-1-batch-1000-docs/104678/1 "2017-10-20T09:02:44Z")

</div>

Warning: using ES 6.0.0-rc1

I've this index:

```
    GET /dfp-base-2017-01-01/_count
   
    {"count": 35961,"_shards": {
    "total": 2,
    "successful": 2,
    "skipped": 0,
    "failed": 0}}

```

Then i run:

```
POST /dfp-base-2017-01-01/_update_by_query
{
   "script":{
     "source":"if(ctx._source.LINE_ITEM_NAME =~/ADMELD/){ctx._source.LINE_ITEM_DEST='ADX';}else{if(ctx._source.LINE_ITEM_NAME =~/IO-SELE15030142-1000/){ctx._source.LINE_ITEM_DEST='REDIRECT';}else{ctx._source.LINE_ITEM_DEST='DFP'}}",
     "lang":"painless"
   },
    "query": {
        "match_all": {}
    }
}

```

The response is:

```
{
  "took": 473,
  "timed_out": false,
  "total": 1000,
  "updated": 1000,
  "deleted": 0,
  "batches": 1,
  "version_conflicts": 0,
  "noops": 0,
  "retries": {
    "bulk": 0,
    "search": 0
  },
  "throttled_millis": 0,
  "requests_per_second": -1,
  "throttled_until_millis": 0,
  "failures": []
}

```

Why it updated 1000 docs using just 1 batch, when i have 35k docs in the index?  
I've tried setting a greater batch size, but doesnt help..  
Maybe it is a 6.0.0 bug?

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 23, 2017, 9:09am UTC](https://discuss.elastic.co/t/update-by-query-updating-just-1-batch-1000-docs/104678/2 "2017-10-23T09:09:35Z")

</div>

hey,

indeed this is an issue. Fixed in [https://github.com/elastic/elasticsearch/pull/26784](https://github.com/elastic/elasticsearch/pull/26784)

--Alex

---

<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:** [November 20, 2017, 9:10am UTC](https://discuss.elastic.co/t/update-by-query-updating-just-1-batch-1000-docs/104678/3 "2017-11-20T09:10:18Z")

</div>

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