public function down()
 {
     $index = \gromver\platform\common\models\elasticsearch\ActiveDocument::index();
     \yii\elasticsearch\ActiveRecord::getDb()->createCommand()->deleteIndex($index);
     //->deleteAllIndexes();//
     echo "Index {$index} are deleted successfully.";
 }
Пример #2
0
 public function init()
 {
     if ($this->elasticsearchIndex) {
         ActiveDocument::$index = $this->elasticsearchIndex;
     } elseif (@Yii::$app->grom->params['elasticsearchIndex']) {
         ActiveDocument::$index = Yii::$app->grom->params['elasticsearchIndex'];
     }
 }