public function createCommand($db = null) { if ($db === null) { $db = Yii::$app->get('elasticsearch'); } $commandConfig = $db->getQueryBuilder()->build($this); return $db->createCommand($commandConfig); }
/** * @inheritdoc */ public function createCommand($db = null) { $this->mapAggregations(); $searchQuery = $this->getSearchQuery(); if ($searchQuery) { $this->query = $this->mapQuery($searchQuery); } return parent::createCommand($db); }