Muna
(Muna)
May 21, 2020, 4:49am
1
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
}
}
]
}
}
dadoonet
(David Pilato)
May 21, 2020, 1:38pm
2
Muna
(Muna)
May 22, 2020, 9:47am
3
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
dadoonet
(David Pilato)
May 22, 2020, 10:19am
4
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.
system
(system)
Closed
June 19, 2020, 10:19am
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.