/** * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { try { $this->mappingCreator->create(); } catch (CannotRecreateIndexException $e) { $output->writeln('<error>Cannot create index, you have to use reindex command!</error>'); return 1; } $output->writeln('<info>Success!</info>'); return 0; }
/** * @param string $newIndexName */ private function createNewIndexMapping($newIndexName) { $this->mappingCreator->setIndex($newIndexName); $this->onBeforeCreatingIndex($newIndexName); $this->mappingCreator->create(FALSE); $this->onAfterCreatingIndex($newIndexName); }
/** * @param InputInterface $input * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { $reCreate = (bool) $input->getOption(self::RECREATE_ARGUMENT); $this->mappingCreator->create($reCreate); return 0; }