Fix issue in reseter when an index does not exist yet
This commit is contained in:
parent
8f3b39d135
commit
333f8850cf
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
|
||||
use Elastica_Exception_Response;
|
||||
|
||||
/**
|
||||
* Deletes and recreates indexes
|
||||
**/
|
||||
|
@ -22,7 +24,11 @@ class Reseter
|
|||
public function reset()
|
||||
{
|
||||
foreach ($this->indexManager->getAllIndexes() as $index) {
|
||||
$index->delete();
|
||||
try {
|
||||
$index->delete();
|
||||
} catch (Elastica_Exception_Response $e) {
|
||||
// The index does not exist
|
||||
}
|
||||
$index->create();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue