protected function indexSubtree($locationId)
{
$contentHandler = $this->persistenceHandler->contentHandler();
$locationHandler = $this->persistenceHandler->locationHandler();
$processedContentIdSet = array();
$subtreeIds = $locationHandler->loadSubtreeIds($locationId);
foreach ($subtreeIds as $locationId => $contentId) {
$this->searchHandler->indexLocation($locationHandler->load($locationId));
if (isset($processedContentIdSet[$contentId])) {
continue;
}
$this->searchHandler->indexContent($contentHandler->load($contentId, $contentHandler->loadContentInfo($contentId)->currentVersionNo));
// Content could be found in multiple Locations of the subtree,
// but we need to (re)index it only once
$processedContentIdSet[$contentId] = true;
}
}