R
R
RS-qrsk2021-07-26 17:39:36
symfony
RS-qrsk, 2021-07-26 17:39:36

Error in FOSElasticaBundle, what's wrong?

I decided to try to make a search on FOSElasticaBundle, installation according to instructions
1. composer require friendsofsymfony/elastica-bundle
2. in config/bundles.php I wrote

FOS\ElasticaBundle\FOSElasticaBundle::class => ['all' => true],


But when using elastic
private $finder;

    public function __construct(PaginatedFinderInterface $finder)
    {
        $this->finder = $finder;
    }

    public function userAction()
    {
        $results = $this->finder->find('тест');
     
       .....
    }


I get an error

Cannot autowire argument $finder of "App\Controller\SearchController::index()": it references interface "FOS\ElasticaBundle\Finder\PaginatedFinderInterface" but no such service exists. Did you create a class that implements this interface?


What am I doing wrong, please tell me.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question