protected function initializeMountPages()
    {
        $mountPagesInitialized = false;
        $mountPages = $this->pagesRepository->findAllMountPagesByWhereClause($this->buildPagesClause() . $this->buildTcaWhereClause() . ' AND doktype = 7 AND no_search = 0');

        if (empty($mountPages)) {
            $mountPagesInitialized = true;
            return $mountPagesInitialized;
        }

        $databaseConnection = $this->queueItemRepository->getConnectionForAllInTransactionInvolvedTables(
            'tx_solr_indexqueue_item',
            'tx_solr_indexqueue_indexing_property'
        );

        foreach ($mountPages as $mountPage) {
            if (!$this->validateMountPage($mountPage)) {
                continue;
            }

            $mountedPages = $this->resolveMountPageTree($mountPage);

            // handling mount_pid_ol behavior
            if ($mountPage['mountPageOverlayed']) {
                // the page shows the mounted page's content
                $mountedPages[] = $mountPage['mountPageSource'];
            } else {
                // Add page like a regular page, as only the sub tree is
                // mounted. The page itself has its own content.
                $indexQueue = GeneralUtility::makeInstance(Queue::class);
                $indexQueue->updateItem($this->type, $mountPage['uid']);
            }

            // This can happen when the mount point does not show the content of the
            // mounted page and the mounted page does not have any subpages.
            if (empty($mountedPages)) {
                continue;
            }

            $databaseConnection->beginTransaction();
            try {
                $this->addMountedPagesToIndexQueue($mountedPages, $mountPage);
                $this->addIndexQueueItemIndexingProperties($mountPage, $mountedPages);

                $databaseConnection->commit();
                $mountPagesInitialized = true;
            } catch (\Exception $e) {
                $databaseConnection->rollBack();

                $this->logger->log(
                    SolrLogManager::ERROR,
                    'Index Queue initialization failed for mount pages',
                    [
                        $e->__toString()
                    ]
                );
                break;
            }
        }

        return $mountPagesInitialized;
    }