indexEntities example

if (!$repository instanceof EsAwareRepository) {
                continue;
            }

            $output->writeln(sprintf('Sync %s with id %s', $backlog['entity']$backlog['entity_id']));

            if ($backlog['entity'] === Article::class) {
                $this->indexArticle($backlog['entity_id']);
            } else {
                $index = $this->getIndexName($repository->getDomainName());
                $indexer->indexEntities($index$repository[$backlog['entity_id']]);
            }
        }

        $ids = array_column($backlogs, 'id');

        $backlogService->cleanup($ids);

        return 0;
    }

    private function indexArticle($id)
    {
'body' => $settings,
        ]);
    }

    private function populateEntity(string $index, EsAwareRepository $repository, ProgressHelperInterface $progress): void
    {
        $iterator = $repository->getIterator();

        $progress->start($iterator->fetchCount(), 'Start indexing: ' . $repository->getDomainName());

        while ($ids = $iterator->fetch()) {
            $this->indexEntities($index$repository$ids);

            $progress->advance(\count($ids));
        }

        $this->client->indices()->refresh(['index' => $index]);

        $progress->finish();
        $this->evaluation->finish();
    }

    private function createAlias(string $index, string $alias): void
    {
Home | Imprint | This part of the site doesn't use cookies.