for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ONGR\ElasticsearchBundle\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
/**
* Symfony command for clearing elasticsearch cache.
class CacheClearCommand extends AbstractManagerAwareCommand
{
* {@inheritdoc}
protected function configure()
parent::configure();
$this
->setName('ongr:es:cache:clear')
->setDescription('Clears elasticsearch client cache.');
}
protected function execute(InputInterface $input, OutputInterface $output)
$io = new SymfonyStyle($input, $output);
->getManager($input->getOption('manager'))
->clearCache();
$io->success(
sprintf(
'Elasticsearch index cache has been cleared for manager named `%s`',
$input->getOption('manager')
)
);