# Limitation on number of docs for the Index action of a Watch?

**URL:** <https://discuss.elastic.co/t/limitation-on-number-of-docs-for-the-index-action-of-a-watch/145699>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 23, 2018, 10:23am UTC](https://discuss.elastic.co/t/limitation-on-number-of-docs-for-the-index-action-of-a-watch/145699 "2018-08-23T10:23:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hardbap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hardbap/32/34608_2.png) [@hardbap](https://discuss.elastic.co/u/hardbap)\
**Post date:** [August 23, 2018, 10:23am UTC](https://discuss.elastic.co/t/limitation-on-number-of-docs-for-the-index-action-of-a-watch/145699/1 "2018-08-23T10:23:46Z")

</div>

I cannot find this documented anywhere but is there a limitation to the number of documents that the Index action will process? We experienced two spikes in messages yesterday (`798` and `3392`) and in each case the watch action only indexed exactly 10 records on each run.

---

<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:** [August 23, 2018, 2:55pm UTC](https://discuss.elastic.co/t/limitation-on-number-of-docs-for-the-index-action-of-a-watch/145699/2 "2018-08-23T14:55:41Z")

</div>

it's very likely that your query did not have a `size` set and thus only returned the first 10 hits.

You can verify this in the daily watch history index.

---

<div class="post-metadata">

**Author:** ![hardbap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hardbap/32/34608_2.png) [@hardbap](https://discuss.elastic.co/u/hardbap)\
**Post date:** [August 23, 2018, 2:59pm UTC](https://discuss.elastic.co/t/limitation-on-number-of-docs-for-the-index-action-of-a-watch/145699/3 "2018-08-23T14:59:19Z")

</div>

I can verify with 100% certainty that the query returned the correct number of hits.

```auto
            "condition": {
              "type": "compare",
              "status": "success",
              "met": true,
              "compare": {
                "resolved_values": {
                  "ctx.payload.hits.total": 798
                }
              }
            }

```

---

<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:** [August 23, 2018, 3:00pm UTC](https://discuss.elastic.co/t/limitation-on-number-of-docs-for-the-index-action-of-a-watch/145699/4 "2018-08-23T15:00:50Z")

</div>

The hits itself are not returned, which are needed for bulk indexing. Just because the **hit count** is one million, it does not mean, that one millions hits/documents will be returned in the response. This is what the `size` parameter is for, which defaults to 10.

Showing the full watch history entry will show this.

---

<div class="post-metadata">

**Author:** ![hardbap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hardbap/32/34608_2.png) [@hardbap](https://discuss.elastic.co/u/hardbap)\
**Post date:** [August 23, 2018, 3:09pm UTC](https://discuss.elastic.co/t/limitation-on-number-of-docs-for-the-index-action-of-a-watch/145699/5 "2018-08-23T15:09:21Z")

</div>

Of course. My bad. Thank you @spinscale

---

<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:** [September 20, 2018, 3:09pm UTC](https://discuss.elastic.co/t/limitation-on-number-of-docs-for-the-index-action-of-a-watch/145699/6 "2018-09-20T15:09:24Z")

</div>

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