public function testThatResetMethodCreateNewIndexes()
 {
     $indexManager = new IndexManager(array('index_1' => new NewIndex(), 'index_2' => new NewIndex()), new NewIndex());
     $reseter = new Reseter($indexManager);
     $reseter->reset();
     $this->assertTrue($indexManager->getIndex('index_1')->created);
     $this->assertTrue($indexManager->getIndex('index_2')->created);
 }
Exemple #2
0
 /**
  * Deletes/remaps an index type, populates it, and refreshes the index.
  *
  * @param OutputInterface $output
  * @param string          $index
  * @param string          $type
  * @param boolean         $reset
  */
 private function populateIndexTypeLimit(OutputInterface $output, $index, $type, $reset, $limit, $start)
 {
     if ($reset) {
         $output->writeln(sprintf('Resetting: %s/%s', $index, $type));
         $this->resetter->resetIndexType($index, $type);
     }
     $loggerClosure = function ($message) use($output, $index, $type) {
         $output->writeln(sprintf('Populating: %s/%s, %s', $index, $type, $message));
     };
     $provider = $this->providerRegistry->getProvider($index, $type);
     $provider->populate($loggerClosure, array('limit' => $limit, 'start' => $start));
     $output->writeln(sprintf('Refreshing: %s', $index));
     $this->indexManager->getIndex($index)->refresh();
 }
Exemple #3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln(implode(' ', array_keys($this->indexManager->getAllIndexes())));
 }