Class App\Domain\User\User is not searchable

Hello,

I am trying to use Algolia in Symfony. I implemented this code:

    $this->em
            ->createQueryBuilder()
            ->select('users')
            ->from(User::class, 'users');

        $users = $this->userRepository->findAll();
        $this->searchService->index($this->em, $users);

        $result = $this->searchService->search(
            $this->em,
            User::class,
            'i',
            [
                'page'                 => 0,
                'hitsPerPage'          => 20,
                'attributesToRetrieve' => [
                ],
            ]
        );
    }

But I am getting this message. "Class App\Domain\User\User is not searchable"

I also tried to use Post objects provided by Algolia, and I am getting the same message Class "Algolia\SearchBundle\TestApp\Entity\Post is not searchable"

Any  though why  I am having this error message?