In some cases, I don't need all of the fields in response json.
For example,
// request json { "_source": "false", "aggs": { ... }, "query": { ... } } // response json { "took": 123, "timed_out": false, "_shards": { ... }, "hits": { "total": 123, "max_score": 123, "hits": [ { "_index": "foo", "_type": "bar", "_id": "123", "_score": 123 } ], ... }, "aggregations": { "foo": { "buckets": [ { "key": 123, "doc_count": 123 }, ... ] } } } Actually I don't need the _index/_type every time. When I do aggregations, I don't need hits block.
"_source" : false or "_source": { "exclude": [ "foobar" ] } can help ignore/exclude the _source fields in hits block.
But can I change the structure of ES response json in a more common way? Thanks.