# Update all documents that were matched against the query in the watcher as part of the watcher action

**URL:** <https://discuss.elastic.co/t/update-all-documents-that-were-matched-against-the-query-in-the-watcher-as-part-of-the-watcher-action/104621>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [October 19, 2017, 9:10pm UTC](https://discuss.elastic.co/t/update-all-documents-that-were-matched-against-the-query-in-the-watcher-as-part-of-the-watcher-action/104621 "2017-10-19T21:10:39Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![naziyakhan](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@naziyakhan](https://discuss.elastic.co/u/naziyakhan)\
**Post date:** [October 24, 2017, 3:29am UTC](https://discuss.elastic.co/t/update-all-documents-that-were-matched-against-the-query-in-the-watcher-as-part-of-the-watcher-action/104621/4 "2017-10-24T03:29:10Z")

</div>

So Alexander, I found [this](https://discuss.elastic.co/t/adding-editing-fields-through-watcher/74909/5) post which seems to accomplish what I am trying to do.  
However, since the update\_by\_query has its own query [in my case match\_all], we might have a window where the documents that have not been used in the watcher's search query will get tagged.  
Again for this, we can use a sliding time window, but is it possible that due some glitch/issue/delay the documents wont end up getting tagged and pickedup again by the next run of the watcher.

---

_[View the full topic](https://discuss.elastic.co/t/update-all-documents-that-were-matched-against-the-query-in-the-watcher-as-part-of-the-watcher-action/104621)._
