Skip to content

top_hits, date_histogram : allow not serializing some of the fields. #7350

@shanielh

Description

@shanielh

Hi.

I would like not to get some of the fields from the response of an API request, since it's killing my CPU time at deserialization of the JSON in the client, I commented the fields that I don't want to receive, Is it possible?

First aggregation is date_histogram, inner aggregation is top_hits, What i've tried to do is to take the last value from every 30 minutes within a date range.

{
   "took" : 21,
   "timed_out" : false,
   "_shards" : {
     "total" : 5,
     "successful" : 5,
     "failed" : 0
   },
   "hits" : {
     "total" : 1715,
     "max_score" : 0.0,
     "hits" : [ ]
   },
   "aggregations" : {
     "my_agg" : {
       "buckets" : [ {
         //"key_as_string" : "2014-08-20T12:00:00.000Z",
         "key" : 1408536000000,
         //"doc_count" : 64,
         "found_hits" : {
           "hits" : {
             // "total" : 64,
             // "max_score" : null,
             "hits" : [ {
               //"_index" : "feed_history",
               // "_type" : "feed_history",
               // "_id" : "de1ea495-13d1-422d-ad44-a96fb0c36af8",
               // "_score" : null,
               "_source":{"value":1.30655,"relatedId":2,"serverTime":"2014-08-20T12:29:59.4410307Z"},
               // "sort" : [ 1408537799441 ]
             } ]
           }
         }
       }, ... ]
     }
   }
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions