# Customize JSON response

**URL:** <https://discuss.elastic.co/t/customize-json-response/5833>\
**Category:** Elasticsearch\
**Created:** [November 10, 2011, 12:35pm UTC](https://discuss.elastic.co/t/customize-json-response/5833 "2011-11-10T12:35:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![achaayan](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@achaayan](https://discuss.elastic.co/u/achaayan)\
**Post date:** [November 10, 2011, 12:35pm UTC](https://discuss.elastic.co/t/customize-json-response/5833/1 "2011-11-10T12:35:19Z")

</div>

Hi,  
Is it possible to cutomize the JSON response, so that I get only the hit  
information, and not the metadata?  
For example, I would like to exclude the following section from the  
response:  
{  
"took" : 375,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 3,  
"successful" : 3,  
"failed" : 0  
},

Please let me know if this can be achieved. Thanks!!

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [November 10, 2011, 12:36pm UTC](https://discuss.elastic.co/t/customize-json-response/5833/2 "2011-11-10T12:36:59Z")

</div>

Why do you want to exclude it , it wont do any harm !!!!  
Wont just ignoring these will do ??

Thanks  
Vineeth

On Thu, Nov 10, 2011 at 6:05 PM, achaayan [felixmd@gmail.com](mailto:felixmd@gmail.com) wrote:

> Hi,  
> Is it possible to cutomize the JSON response, so that I get only the hit  
> information, and not the metadata?  
> For example, I would like to exclude the following section from the  
> response:  
> {  
> "took" : 375,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 3,  
> "successful" : 3,  
> "failed" : 0  
> },
> 
> Please let me know if this can be achieved. Thanks!!

---

<div class="post-metadata">

**Author:** ![achaayan](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@achaayan](https://discuss.elastic.co/u/achaayan)\
**Post date:** [November 10, 2011, 12:52pm UTC](https://discuss.elastic.co/t/customize-json-response/5833/3 "2011-11-10T12:52:41Z")

</div>

I need to transform the response, so that I can render it in my view. It  
would like to know if exclusion of metadata can be done.

---

<div class="post-metadata">

**Author:** ![Gabriel\_Farrell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_farrell/32/3337_2.png) [@Gabriel\_Farrell](https://discuss.elastic.co/u/Gabriel_Farrell)\
**Post date:** [November 10, 2011, 5:43pm UTC](https://discuss.elastic.co/t/customize-json-response/5833/4 "2011-11-10T17:43:14Z")

</div>

On Thu, Nov 10, 2011 at 7:52 AM, achaayan [felixmd@gmail.com](mailto:felixmd@gmail.com) wrote:

> I need to transform the response, so that I can render it in my view. It  
> would like to know if exclusion of metadata can be done.

What kind of client are you using that you can't transform the JSON on  
the client side?

---

<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:** [November 13, 2011, 7:10am UTC](https://discuss.elastic.co/t/customize-json-response/5833/5 "2011-11-13T07:10:07Z")

</div>

There isn't an option to transform the response on elasticsearch side.

On Thu, Nov 10, 2011 at 2:35 PM, achaayan [felixmd@gmail.com](mailto:felixmd@gmail.com) wrote:

> Hi,  
> Is it possible to cutomize the JSON response, so that I get only the hit  
> information, and not the metadata?  
> For example, I would like to exclude the following section from the  
> response:  
> {  
> "took" : 375,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 3,  
> "successful" : 3,  
> "failed" : 0  
> },
> 
> Please let me know if this can be achieved. Thanks!!

---

<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, 3:48am UTC](https://discuss.elastic.co/t/customize-json-response/5833/6 "2017-07-06T03:48:58Z")

</div>


