public function search(string $string, string $resources = ''): array
    {
        $query = $this->getRepository('Search')
            ->query()
            ->setParameter('query', $string);
        if ($resources) {
            $query->setParameter('resources', \mb_strtolower($resources));
        }

        return $query->find();
    }