for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace GBProd\ElasticaExtraBundle\Handler;
use Elastica\Client;
use Elastica\Tool\CrossIndex;
/**
* Handler for reindex
*
* @author gbprod <[email protected]>
*/
class ReindexHandler
{
* @var string
public static $crossIndexClassname = CrossIndex::class;
* Reindex handler
* @param Client $client
* @param string $oldIndex
* @param string $newIndex
public function handle(Client $client, $oldIndex, $newIndex)
$classname = self::$crossIndexClassname;
$classname::reindex(
$client->getIndex($oldIndex),
$client->getIndex($newIndex)
);
}