Skip to content

Commit

Permalink
feat: add _parent to document
Browse files Browse the repository at this point in the history
  • Loading branch information
danjohnson95 committed Apr 2, 2020
1 parent 66b8aff commit 7011e9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/QueryProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public function documentFromResult(Builder $query, array $result): array
$document = $result['_source'];
$document['_id'] = $result['_id'];

if (! empty($result['_parent'])) {
$document['_parent'] = $result['_parent'];
}

if ($query->includeInnerHits && isset($result['inner_hits'])) {
$document = $this->addInnerHitsToDocument($document, $result['inner_hits']);
}
Expand Down

0 comments on commit 7011e9c

Please sign in to comment.