Remove unnecessary elements from result for inner hits

From this inner hits search result I'd like to only get the source of the inner hits,
and not include the nested fields section for each hit( just before the score), because if there are numerous inner hits, including that same fields section would introduce a lot of extra data i don't need.
How?

{
"hits": {
"total": 1,
"max_score": 0.6931472,
"hits": [
{
"_index": "test",
"_type": "doc",
"_id": "1",
"_score": 0.6931472,
"_source": ...,
"inner_hits": {
"comments.votes": {
"hits": {
"total": 1,
"max_score": 0.6931472,
"hits": [
{
// remove this next section between comments
"_nested": {
"field": "comments",
"offset": 1,
"_nested": {
"field": "votes",
"offset": 0
}
},
//

              "_score": 0.6931472,
              "_source": {
                "value": 1,
                "voter": "kimchy"
              }
            }
          ]
        }
      }
    }
  }
]

}
}

part I don't need in inner_hits.hits.hits section

              "_nested": {
                "field": "comments",
                "offset": 1,
                "_nested": {
                  "field": "votes",
                  "offset": 0
                }
              }

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