Customize JSON response


(achaayan) #1

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!!


(vineeth mohan) #2

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 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!!


(achaayan) #3

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.


(Gabriel Farrell) #4

On Thu, Nov 10, 2011 at 7:52 AM, achaayan 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?


(Shay Banon) #5

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 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!!


(system) #6