# Registering listener to an index through elasticsearch plugin

**URL:** <https://discuss.elastic.co/t/registering-listener-to-an-index-through-elasticsearch-plugin/20900>\
**Category:** Elasticsearch\
**Created:** [November 22, 2014, 8:06pm UTC](https://discuss.elastic.co/t/registering-listener-to-an-index-through-elasticsearch-plugin/20900 "2014-11-22T20:06:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milad\_Alshomary](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Milad\_Alshomary](https://discuss.elastic.co/u/Milad_Alshomary)\
**Post date:** [November 22, 2014, 8:06pm UTC](https://discuss.elastic.co/t/registering-listener-to-an-index-through-elasticsearch-plugin/20900/1 "2014-11-22T20:06:59Z")

</div>

Is there any way to write an elastic plugin that can listen to an index and  
get notified with the document that is being inserted to this index ?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/716d743f-87cb-4d3c-897d-553b5b91358c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/716d743f-87cb-4d3c-897d-553b5b91358c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 22, 2014, 9:02pm UTC](https://discuss.elastic.co/t/registering-listener-to-an-index-through-elasticsearch-plugin/20900/2 "2014-11-22T21:02:26Z")

</div>

You can add a listener to all (primary) shards of an index using  
ShardIndexingService and capture indexing operations with preIndex() or  
postIndex() method.

Jörg

On Sat, Nov 22, 2014 at 9:06 PM, Milad Alshomary [milad.alshomary@gmail.com](mailto:milad.alshomary@gmail.com)  
wrote:

> Is there any way to write an elastic plugin that can listen to an index  
> and get notified with the document that is being inserted to this index ?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/716d743f-87cb-4d3c-897d-553b5b91358c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/716d743f-87cb-4d3c-897d-553b5b91358c%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/716d743f-87cb-4d3c-897d-553b5b91358c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/716d743f-87cb-4d3c-897d-553b5b91358c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGi%3DUoiJK2Fa2zSvm0wYYj61WFbqts2xo%3D\_2sU87Dg%2BPA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGi%3DUoiJK2Fa2zSvm0wYYj61WFbqts2xo%3D_2sU87Dg%2BPA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:48am UTC](https://discuss.elastic.co/t/registering-listener-to-an-index-through-elasticsearch-plugin/20900/3 "2017-07-06T00:48:16Z")

</div>


