How to get only the ‘_source’ part of the hits. of the result

is there any way to get only the '_source' part of the result of the query .

Like from below result i want only the source part from the hits.

{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [
{
"_index" : "abc",
"_type" : "abc",
"_id" : "13",
"_score" : 1.0,
"_source" : {
"abc":125
}
}
]
}
}

See https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#common-options-response-filtering

Hi,
tried using below

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

but once i get respone i need to loop through all to get "_source".

i want to get data directly and use

As you might have more than one hit, it must be an array.
You need to do this transformation in your application.

If you know the id of the document (and you are not searching) then you can do it.

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