/** * 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(); }
/** * Deletes/remaps an index type, populates it, and refreshes the index. * * @param OutputInterface $output * @param string $index * @param string $type * @param boolean $reset * @param array $options */ private function populateIndexType(OutputInterface $output, $index, $type, $reset, $options) { if ($reset) { $output->writeln(sprintf('<info>Resetting</info> <comment>%s/%s</comment>', $index, $type)); $this->resetter->resetIndexType($index, $type); } $loggerClosure = function ($message) use($output, $index, $type) { $output->writeln(sprintf('<info>Populating</info> %s/%s, %s', $index, $type, $message)); }; $provider = $this->providerRegistry->getProvider($index, $type); $provider->populate($loggerClosure, $options); $output->writeln(sprintf('<info>Refreshing</info> <comment>%s</comment>', $index)); $this->indexManager->getIndex($index)->refresh(); }
public function testGetDefaultIndex() { $this->assertEquals('test2', $this->indexManager->getIndex()); $this->assertEquals('test2', $this->indexManager->getDefaultIndex()); }