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."; }
public function init() { if ($this->elasticsearchIndex) { ActiveDocument::$index = $this->elasticsearchIndex; } elseif (@Yii::$app->grom->params['elasticsearchIndex']) { ActiveDocument::$index = Yii::$app->grom->params['elasticsearchIndex']; } }