public function onHit(HitEvent $event)
    {
        if (false === $event->getMetadata()->reflection->isSubclassOf(BasePageDocument::class)) {
            return;
        }

        $document = $event->getHit()->getDocument();
        if ('/' !== $document->getUrl()[0]) {
            // is absolute URL

            return;
        }

        $url = sprintf(
            '%s/%s',
            rtrim($this->requestAnalyzer->getResourceLocatorPrefix(), '/'),
            ltrim($document->getUrl(), '/')
        );

        $document->setUrl($url);
    }