private function createLanguageIndex(LanguageEntity
$language, \DateTime
$timestamp): void
{ $context =
$this->
createLanguageContext($language);
foreach ($this->registry->
getDefinitions() as $definition) { $alias =
$this->helper->
getIndexName($definition->
getEntityDefinition(),
$language->
getId());
$index =
$alias . '_' .
$timestamp->
getTimestamp();
$hasAlias =
$this->indexCreator->
aliasExists($alias);
$this->indexCreator->
createIndex($definition,
$index,
$alias,
$context);
$iterator =
$this->iteratorFactory->
createIterator($definition->
getEntityDefinition());
// We don't need an index task, when it's the first indexing. This will allow alias swapping to nothing
if ($hasAlias) { $this->connection->
insert('elasticsearch_index_task',
[ 'id' => Uuid::
randomBytes(),
'`entity`' =>
$definition->
getEntityDefinition()->
getEntityName(),
'`index`' =>
$index,