Class App\Domain\User\User is not searchable


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

            ->from(User::class, 'users');

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

        $result = $this->searchService->search(
                '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?