I have many field in _source
of indexed document. However I don't need all of them to be returned form search query. For now for each found document the whole _source
is returned. How I can force to receive only specific fields of each _source
?
So to answer your answer in general,
For version < 1
use (in search request)
{
"fields" : ["fields you want to get"]
}
so response contains fields, not source
if version > = 1 then,
you can use
{
"_source":[ "fields to include"]
}
source filtering can be found here .
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With