src/Kunstmaan/NodeSearchBundle/Configuration/NodePagesConfiguration.php
protected function addParentAndAncestors($node, &$doc)
    {
        $parent = $node->getParent();

        if ($parent) {
            $doc['parent'] = $parent->getId();
            $ancestors = [];
            do {
                $ancestors[] = $parent->getId();
                $parent = $parent->getParent();
            } while ($parent);
            $doc['ancestors'] = $ancestors;
        }
    }
protected function addParentAndAncestors($node, &$doc)
    {
        $parent = $node->getParent();

        if ($parent) {
            $doc['parent'] = $parent->getId();
            $ancestors = [];
            do {
                $ancestors[] = $parent->getId();
                $parent = $parent->getParent();
            } while ($parent);
            $doc['ancestors'] = $ancestors;
        }
    }
protected function addParentAndAncestors ( $ node , & $ doc ) { $ parent = $ node -> getParent ( ) ; if ( $ parent ) { $ doc [ 'parent' ] = $ parent -> getId ( ) ; $ ancestors = [ ] ; do { $ ancestors [ ] = $ parent -> getId ( ) ; $ parent = $ parent -> getParent ( ) ; } while ( $ parent ) ; $ doc [ 'ancestors' ] = $ ancestors ; } }
Add parent nodes to the index document

@param Node  $node
@param array $doc

@return array
Add parent nodes to the index document