I have the following query:
GET /networkcollection/branch_routers/_search/
{
"query": {
"nested": {
"path": "queries",
"query": {
"bool": {
"must": [
{ "match":
{ "queries.dateQuery": "20160101T200000.000Z" }
}
]
}
},
"inner_hits" : {}
}
}
}
This returns both the "hits" object (the entire document), as well as the "inner_hits" object (nested inside of hits).
Is there a way to for me to only return the matched "queries" element(s) which appear in the "inner_hits" results, without getting the whole document?
Should be able to achieve it by disabling source-field at top-level by specifying "_source" : false
POST /networkcollection/branch_routers/_search/
{
"_source" : false,
"query": {
"nested": {
"path": "queries",
"query": {
"bool": {
"must": [
{ "match":
{ "queries.dateQuery": "20160101T200000.000Z" }
}
]
}
},
"inner_hits" : {}
}
}
}
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