# Filter and extend json response

**URL:** <https://discuss.elastic.co/t/filter-and-extend-json-response/3980>\
**Category:** Elasticsearch\
**Created:** [February 25, 2011, 12:10pm UTC](https://discuss.elastic.co/t/filter-and-extend-json-response/3980 "2011-02-25T12:10:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ridvan\_Gyundogan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ridvan\_Gyundogan](https://discuss.elastic.co/u/Ridvan_Gyundogan)\
**Post date:** [February 25, 2011, 12:10pm UTC](https://discuss.elastic.co/t/filter-and-extend-json-response/3980/1 "2011-02-25T12:10:06Z")

</div>

I want to extend the json response with some custom logic data, from  
business specific needs. Is there a plugin mechanism or something I  
can do this.

For exampe to add in the response:  
{  
userdata:{  
"prop1":"aaaa",  
"prop2":"bbbb",  
}  
hits:{  
...........................  
}  
}

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 25, 2011, 7:55pm UTC](https://discuss.elastic.co/t/filter-and-extend-json-response/3980/2 "2011-02-25T19:55:35Z")

</div>

No, you need to proxy the call to elasticsearch yourself, and add what you want. Where do you get that data from?  
On Friday, February 25, 2011 at 2:10 PM, Ridvan Gyundogan wrote:

> I want to extend the json response with some custom logic data, from  
> business specific needs. Is there a plugin mechanism or something I  
> can do this.
> 
> For exampe to add in the response:  
> {  
> userdata:{  
> "prop1":"aaaa",  
> "prop2":"bbbb",  
> }  
> hits:{  
> ...........................  
> }  
> }

---

<div class="post-metadata">

**Author:** ![Ridvan\_Gyundogan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ridvan\_Gyundogan](https://discuss.elastic.co/u/Ridvan_Gyundogan)\
**Post date:** [February 26, 2011, 7:23am UTC](https://discuss.elastic.co/t/filter-and-extend-json-response/3980/3 "2011-02-26T07:23:38Z")

</div>

Hi kimchy,  
thanks for the answer.

I agreee it is a better idea to proxy it, es doesn' need to care about this.  
I was just curious whether it' possible to write such custom plugin, I see  
you use plugins for some functionality.

The data we want to extend the response with at the moment comes from a  
database, we are also thinking over the possibility to put it in a different  
type in the es.

On Fri, Feb 25, 2011 at 9:55 PM, Shay Banon \<shay.banon@etter  
[lasticsearch.com](http://lasticsearch.com)\> wrote:

> No, you need to proxy the call to elasticsearch yourself, and add what  
> you want. Where do you get that data from?
> 
> On Friday, February 25, 2011 at 2:10 PM, Ridvan Gyundogan wrote:
> 
> I want to extend the json response with some custom logic data, from  
> business specific needs. Is there a plugin mechanism or something I  
> can do this.
> 
> For exampe to add in the response:  
> {  
> userdata:{  
> "prop1":"aaaa",  
> "prop2":"bbbb",  
> }  
> hits:{  
> ...........................  
> }  
> }

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 26, 2011, 7:56pm UTC](https://discuss.elastic.co/t/filter-and-extend-json-response/3980/4 "2011-02-26T19:56:38Z")

</div>

There isn't an extension point for that. And, things like that shouldn't probably exist in elasticsearch.  
On Saturday, February 26, 2011 at 9:23 AM, Ridvan Gyundogan wrote:

> Hi kimchy,  
> thanks for the answer.
> 
> I agreee it is a better idea to proxy it, es doesn' need to care about this. I was just curious whether it' possible to write such custom plugin, I see you use plugins for some functionality.
> 
> The data we want to extend the response with at the moment comes from a database, we are also thinking over the possibility to put it in a different type in the es.
> 
> On Fri, Feb 25, 2011 at 9:55 PM, Shay Banon \<shay.banon@etter [lasticsearch.com](http://lasticsearch.com)\> wrote:
> 
> > No, you need to proxy the call to elasticsearch yourself, and add what you want. Where do you get that data from?  
> > On Friday, February 25, 2011 at 2:10 PM, Ridvan Gyundogan wrote:
> > 
> > > I want to extend the json response with some custom logic data, from  
> > > business specific needs. Is there a plugin mechanism or something I  
> > > can do this.
> > > 
> > > For exampe to add in the response:  
> > > {  
> > > userdata:{  
> > > "prop1":"aaaa",  
> > > "prop2":"bbbb",  
> > > }  
> > > hits:{  
> > > ...........................  
> > > }  
> > > }

---

<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, 4:11am UTC](https://discuss.elastic.co/t/filter-and-extend-json-response/3980/5 "2017-07-06T04:11:22Z")

</div>


