Skip to content

Commit

Permalink
BUGFIX: Skip content with hidden parent nodes in fulltext index
Browse files Browse the repository at this point in the history
Relates: #214 #377
  • Loading branch information
Sebobo committed Feb 25, 2025
1 parent 6ce6aa9 commit 7efed7b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Classes/Indexer/NodeIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ public function indexNode(NodeInterface $node, $targetWorkspaceName = null): voi
}
}

// Don't index node into fulltext if it has a hidden parent node that is not a fulltext root
// Example: If a text node is in a hidden container element, it should not be indexed into the document
$parentNode = $node;
while (($parentNode = $parentNode->getParent())
&& !$parentNode->getNodeType()->getConfiguration('search.fulltext.isRoot')) {
if (!$parentNode->isVisible()) {
return;
}
}

$documentIdentifier = $this->documentIdentifierGenerator->generate($node, $targetWorkspaceName);
$nodeType = $node->getNodeType();

Expand Down

0 comments on commit 7efed7b

Please sign in to comment.