# Intercepting and modifying the response?

**URL:** <https://discuss.elastic.co/t/intercepting-and-modifying-the-response/12517>\
**Category:** Elasticsearch\
**Created:** [June 22, 2013, 12:52am UTC](https://discuss.elastic.co/t/intercepting-and-modifying-the-response/12517 "2013-06-22T00:52:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [June 22, 2013, 12:52am UTC](https://discuss.elastic.co/t/intercepting-and-modifying-the-response/12517/1 "2013-06-22T00:52:36Z")

</div>

Hi,

What is the right place to hook into ES aggregator node and:

- intercept and look at the response
- do some other work (e.g. look up some external data, run another query,  
etc.)
- and then modify the original response before returning it to the caller

?

## Thanks, Otis

Search Analytics - [http://sematext.com/search-analytics/index.html](http://sematext.com/search-analytics/index.html)  
Performance Monitoring - [http://sematext.com/spm/index.html](http://sematext.com/spm/index.html)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [June 28, 2013, 4:01pm UTC](https://discuss.elastic.co/t/intercepting-and-modifying-the-response/12517/2 "2013-06-28T16:01:46Z")

</div>

Hi,

Jörg wrote about a custom rest action on  
[http://jprante.github.io/lessons/2012/03/27/Writing-a-simple-plugin-for-Elasticsearch.html](http://jprante.github.io/lessons/2012/03/27/Writing-a-simple-plugin-for-Elasticsearch.html)  
, but is there really nothing else that can be done to plug some custom  
logic/code that acts on data in the response and adds something to it?

## Thanks, Otis

Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

On Friday, June 21, 2013 8:52:36 PM UTC-4, Otis Gospodnetic wrote:

> Hi,
> 
> What is the right place to hook into ES aggregator node and:
> 
> - intercept and look at the response
> - do some other work (e.g. look up some external data, run another query,  
> etc.)
> - and then modify the original response before returning it to the caller
> 
> ?
> 
> ## Thanks, Otis
> 
> Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
> Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 28, 2013, 5:03pm UTC](https://discuss.elastic.co/t/intercepting-and-modifying-the-response/12517/3 "2013-06-28T17:03:01Z")

</div>

From what I can tell, new query types (request/response) are pluggable, but  
nothing like Solr's request handlers. Still hoping for a facet refactor and  
that said refactor leads to some overall query side refactor.

--  
Ivan

On Fri, Jun 28, 2013 at 9:01 AM, Otis Gospodnetic \<  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:

> Hi,
> 
> Jörg wrote about a custom rest action on  
> [http://jprante.github.io/lessons/2012/03/27/Writing-a-simple-plugin-for-Elasticsearch.html](http://jprante.github.io/lessons/2012/03/27/Writing-a-simple-plugin-for-Elasticsearch.html), but is there really nothing else that can be done to plug some custom  
> logic/code that acts on data in the response and adds something to it?
> 
> ## Thanks, Otis
> 
> Search Analytics - [http://sematext.com/search-\*\*analytics/index.html](http://sematext.com/search-**analytics/index.html)[http://sematext.com/search-analytics/index.html](http://sematext.com/search-analytics/index.html)  
> Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/**index.html)[http://sematext.com/spm/index.html](http://sematext.com/spm/index.html)
> 
> On Friday, June 21, 2013 8:52:36 PM UTC-4, Otis Gospodnetic wrote:
> 
> > Hi,
> > 
> > What is the right place to hook into ES aggregator node and:
> > 
> > - intercept and look at the response
> > - do some other work (e.g. look up some external data, run another query,  
> > etc.)
> > - and then modify the original response before returning it to the caller
> > 
> > ?
> > 
> > ## Thanks, Otis
> > 
> > Search Analytics - [http://sematext.com/search-\*\*analytics/index.html](http://sematext.com/search-**analytics/index.html)[http://sematext.com/search-analytics/index.html](http://sematext.com/search-analytics/index.html)  
> > Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/**index.html)[http://sematext.com/spm/index.html](http://sematext.com/spm/index.html)
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:28am UTC](https://discuss.elastic.co/t/intercepting-and-modifying-the-response/12517/4 "2017-07-06T02:28:59Z")

</div>


