mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-22 05:56:11 +01:00
FEATURE: Add new feature to cli
This commit is contained in:
parent
541c6db53a
commit
28ef07cbd7
1 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,7 @@ namespace Leonmrni\SearchCore\Command;
|
|||
*/
|
||||
|
||||
use Leonmrni\SearchCore\Domain\Index\IndexerFactory;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\CommandController;
|
||||
|
||||
/**
|
||||
|
@ -33,6 +34,12 @@ class IndexCommandController extends CommandController
|
|||
*/
|
||||
protected $indexerFactory;
|
||||
|
||||
/**
|
||||
* @var \Leonmrni\SearchCore\Configuration\ConfigurationContainerInterface
|
||||
* @inject
|
||||
*/
|
||||
protected $configuration;
|
||||
|
||||
/**
|
||||
* @param IndexerFactory $factory
|
||||
*/
|
||||
|
@ -50,6 +57,11 @@ class IndexCommandController extends CommandController
|
|||
{
|
||||
// TODO: Allow to index multiple tables at once?
|
||||
// TODO: Also allow to index everything?
|
||||
if (! in_array($table, GeneralUtility::trimExplode(',', $this->configuration->get('index', 'allowedTables')))) {
|
||||
$this->outputLine('Table is not allowed for indexing.');
|
||||
$this->quit(1);
|
||||
}
|
||||
$this->indexerFactory->getIndexer($table)->indexAllDocuments();
|
||||
$this->outputLine('Table was indexed.');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue