Get both parent and child document

You can use inner hits for this:

{
   "query" : {
       "has_child" : {
          "type" "comments",
          "inner_hits" : {}
      }
}

This will include per post hit the top 3 matching comment hits.

1 Like