protected function execute(InputInterface
$input, OutputInterface
$output): int
{ $io =
new SymfonyStyle($input,
$output);
$answer =
$io->
ask('Are you sure you want to reset the Elasticsearch indexing?', 'yes'
);
if ($answer !== 'yes'
) { $io->
error('Canceled clearing indexing process'
);
return self::SUCCESS;
} $indices =
$this->detector->
getAllUsedIndices();
foreach ($indices as $index) { $this->client->
indices()->
delete(['index' =>
$index]);
} $this->connection->
executeStatement('TRUNCATE elasticsearch_index_task'
);
try { $gateway =
$this->gatewayRegistry->
get(IncrementGatewayRegistry::MESSAGE_QUEUE_POOL
);
$gateway->
reset('message_queue_stats', ElasticsearchIndexingMessage::
class);
} catch (IncrementGatewayNotFoundException
) {