# Input a document triggers a task

**URL:** <https://discuss.elastic.co/t/input-a-document-triggers-a-task/39159>\
**Category:** Elasticsearch\
**Created:** [January 13, 2016, 9:14pm UTC](https://discuss.elastic.co/t/input-a-document-triggers-a-task/39159 "2016-01-13T21:14:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimyoo](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jimyoo](https://discuss.elastic.co/u/jimyoo)\
**Post date:** [January 13, 2016, 9:14pm UTC](https://discuss.elastic.co/t/input-a-document-triggers-a-task/39159/1 "2016-01-13T21:14:24Z")

</div>

In ElasticSearch, is there a way that when a document is added it will trigger some other task?  
For example, a document has contents “reader\_count" is 3.  
When that document is added to Elastic, Elastic (or triggers a task to) updates another document’s “total\_reader\_count” as += 3.

Wonder if this kind of thing is possible without querying.  
Thanks in advance,

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 13, 2016, 9:20pm UTC](https://discuss.elastic.co/t/input-a-document-triggers-a-task/39159/2 "2016-01-13T21:20:11Z")

</div>

It's not directly, no.  
You could do something with Watcher, or perhaps Percolator.

---

<div class="post-metadata">

**Author:** ![jimyoo](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jimyoo](https://discuss.elastic.co/u/jimyoo)\
**Post date:** [January 16, 2016, 1:37am UTC](https://discuss.elastic.co/t/input-a-document-triggers-a-task/39159/3 "2016-01-16T01:37:11Z")

</div>

It seems I can use Percolator to do what is needed.  
Thanks for the information.

---

<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:** [July 5, 2017, 11:23pm UTC](https://discuss.elastic.co/t/input-a-document-triggers-a-task/39159/4 "2017-07-05T23:23:53Z")

</div>


