Elasticsearch - how to return only data, not meta information?
elasticsearch
Solution
No, it's not possible at this moment. If performance and complexity of parsing are the main concerns, you might want to consider using different clients: java client or Thrift plugin, for example.
Problem
When doing a search, Elasticsearch returns a data structure that contains various meta information. The actual result set is contained within a "hits" field within the JSON result returned from the database. Is it possible for Elasticsearch to return only the needed data (the contents of then "hits" field) without being embedded within all the other meta data? I know I could parse the result into JSON and extract it, but I don't want the complexity, hassle, performance hit. thanks! Here is an example of the data structure that Elasticsearch returns. ``` { "_shards":{ "total" : 5, "successful" : 5, "failed" : 0 }, "hits":{ "total" : 1, "hits" : [ { "_index" : "twitter", "_type" : "tweet", "_id" : "1", "_source" : { "user" : "kimchy", "postDate" : "2009-11-15T14:12:12", "message" : "trying out Elastic Search" } } ] } } ```