public function getDocumentBySlug($slug)
    {
        $search = $this->repository->createSearch();
        $search->addQuery(new TermQuery('slug', $slug), 'must');

        $results = $this->repository->execute($search);

        if (count($results) === 0) {
            $this->logger && $this->logger->warning(
                sprintf("Can not render snippet for '%s' because content was not found.", $slug)
            );

            return null;
        }

        return $results->current();
    }