Пример #1
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();
 }
Пример #2
0
 /**
  * @expectedException InvalidArgumentException
  */
 public function testResetIndexTypeShouldThrowExceptionForInvalidType()
 {
     $resetter = new Resetter($this->indexConfigsByName);
     $resetter->resetIndexType('foo', 'c');
 }