public function clear()
    {
        /** @var PageCategory $pageCategory */
        $pageCategory = $this->app[PageCategory::class];

        /** @var PageKey $key */
        foreach ($pageCategory->getList() as $key) {
            /** @var SearchIndexerInterface $indexer */
            $indexer = $key->getSearchIndexer();

            // Update the key tables
            $indexer->updateSearchIndexKeyColumns($pageCategory, $key);
        }

        // Truncate the existing search index
        $database = $this->app['database']->connection();
        $database->Execute('truncate table PageSearchIndex');
    }