Filter out only the _source

After performing a GET request, i get a response like the below. I only need the _source field for the response. So my response should not include 'hits' nor '_source'. Just the values of the _source which are: id, house and number... Is this possible?

{
      "took" : 1,
      "timed_out" : false,
      "_shards" : {
        "total" : 5,
        "successful" : 5,
        "skipped" : 0,
        "failed" : 0
      },
      "hits" : {
        "total" : 4,
        "max_score" : 14.538044,
        "hits" : [
          {
            "_index" : "bag",
            "_type" : "doc",
            "_id" : "FEUewnUB_YARoTylqSut",
            "_score" : 14.538044,
            "_source" : {
              "id" : "5tt4",
              "house" : "8302",
              "number" : "83"
            }
          },
          {
            "_index" : "bag",
            "_type" : "doc",
            "_id" : "zKlixHUB_YARoTyljWUw",
            "_score" : 14.5372305,
            "_source" : {
              "id" : "4rr4",
              "house" : "322",
              "number" : "33"
            }
          }]

I believe this is the closest you can get to what you are looking for.

GET INDEXNAME/_search?filter_path=hits.hits._source

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.