Can we get required fields from source using innerhits of nested object

Hi All,

I wanted to know whether we can get selected fields using innerhits from nested object like,
{
"query": {
"nested": {
"path": "",
"query": {
"range": {
"toDate": {
"gte": "2015-01-01",
"lte": "2016-12-31"
}
}
},
"inner_hits": {
"_source": ["fromDate"],
"highlight": {
"fields": {
"toDate": {}
}
}
}
}
}
}

Please let me know above innerhits query will work, I want to retrieve only selected fields inside the innerhits response.

Thanks,
Ram

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