コード例 #1
0
 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
ファイル: Module.php プロジェクト: gromver/yii2-platform
 public function init()
 {
     if ($this->elasticsearchIndex) {
         ActiveDocument::$index = $this->elasticsearchIndex;
     } elseif (@Yii::$app->grom->params['elasticsearchIndex']) {
         ActiveDocument::$index = Yii::$app->grom->params['elasticsearchIndex'];
     }
 }