예제 #1
0
 /**
  * A command run when a population has finished.
  *
  * @param $indexName
  */
 public function postPopulate($indexName)
 {
     $indexConfig = $this->configManager->getIndexConfiguration($indexName);
     if ($indexConfig->isUseAlias()) {
         $index = $this->indexManager->getIndex($indexName);
         $this->aliasProcessor->switchIndexAlias($indexConfig, $index);
     }
 }
 /**
  * Refreshes an index.
  *
  * @param OutputInterface $output
  * @param string          $index
  * @param bool            $postPopulate
  */
 private function refreshIndex(OutputInterface $output, $index, $postPopulate = true)
 {
     if ($postPopulate) {
         $this->resetter->postPopulate($index);
     }
     $output->writeln(sprintf('<info>Refreshing</info> <comment>%s</comment>', $index));
     $this->indexManager->getIndex($index)->refresh();
 }
 public function testGetDefaultIndex()
 {
     $this->assertEquals('index2', $this->indexManager->getIndex()->getName());
     $this->assertEquals('index2', $this->indexManager->getDefaultIndex()->getName());
 }