Inner Hits including parent document

Is there possible to get work something like this? I've tried inner_hits also from parent to child, but still no effect.
ES 5.6
I thing, something is disabled, because inner_hits are not applied. I can not find whats wrong.
Mappings has _parent and documents are indexed with reference to parent. It works, because has_parent and has_child filter works as expected.

Whats wrong with inner hits? :confused:

{
  "index": "??",
  "size": 1,
  "body": {
    "query": {
      "has_parent": {
        "parent_type": "Parent",
        "inner_hits": {
          "name": "NameOfHits"
        }
      }
    }
  }
}

That should work. Can you share your mappings?

Just simply set _parent mappings for child documents. Childs are indexed with parent ID value

'TicketFlow'             => [
    '_parent'    => [
        'type' => 'Ticket',
    ],
    '_routing'   => [
        'required' => true,
    ],
    'properties' => [...]
],

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