Skip to content

Commit c42d689

Browse files
committed
BUGFIX: ES5 Document property 'fields' has been renamed to '_source'
1 parent 9b9c671 commit c42d689

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Classes/Eel/ElasticSearchQueryBuilder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,10 @@ protected function convertHitsToNodes(array $hits)
728728
* we might be able to use https://github.com/elasticsearch/elasticsearch/issues/3300 as soon as it is merged.
729729
*/
730730
foreach ($hits['hits'] as $hit) {
731-
$nodePath = current($hit['fields']['__path']);
731+
$nodePath = $hit[isset($hit['fields']) ? 'fields' : '_source']['__path'];
732+
if (is_array($nodePath)) {
733+
$nodePath = current($nodePath);
734+
}
732735
$node = $this->contextNode->getNode($nodePath);
733736
if ($node instanceof NodeInterface && !isset($nodes[$node->getIdentifier()])) {
734737
$nodes[$node->getIdentifier()] = $node;

0 commit comments

Comments
 (0)