Error Info: Array ( [requestMethod] => GET [requestUrl] => http://127.0.0.1:9200/_nodes/_all/http [requestBody] => [responseHeaders] => Array ( ) [responseBody] => )
Yii::trace("Sending request to elasticsearch node: $method $url\n$requestBody", __METHOD__); if ($profile !== false) { Yii::beginProfile($profile, __METHOD__); } $this->resetCurlHandle(); curl_setopt($this->_curl, CURLOPT_URL, $url); curl_setopt_array($this->_curl, $options); if (curl_exec($this->_curl) === false) { throw new Exception('Elasticsearch request failed: ' . curl_errno($this->_curl) . ' - ' . curl_error($this->_curl), [ 'requestMethod' => $method, 'requestUrl' => $url, 'requestBody' => $requestBody, 'responseHeaders' => $headers, 'responseBody' => $this->decodeErrorBody($body), ]); } $responseCode = curl_getinfo($this->_curl, CURLINFO_HTTP_CODE);
$node = reset($this->nodes); $host = $node['http_address']; $protocol = isset($node['protocol']) ? $node['protocol'] : $this->defaultProtocol; if (strncmp($host, 'inet[/', 6) === 0) { $host = substr($host, 6, -1); } $response = $this->httpRequest('GET', "$protocol://$host/_nodes/_all/http"); if (!empty($response['nodes'])) { $nodes = $response['nodes']; } else { $nodes = []; }
} if (empty($this->nodes)) { throw new InvalidConfigException('elasticsearch needs at least one node to operate.'); } $this->_curl = curl_init(); if ($this->autodetectCluster) { $this->populateNodes(); } $this->selectActiveNode(); Yii::trace('Opening connection to elasticsearch. Nodes in cluster: ' . count($this->nodes) . ', active node: ' . $this->nodes[$this->activeNode]['http_address'], __CLASS__); $this->initConnection(); }
* Creates a command for execution. * @param array $config the configuration for the Command class * @return Command the DB command */ public function createCommand($config = []) { $this->open(); $config['db'] = $this; $command = new Command($config); return $command; }
if ($this->index === null) { $this->index = $modelClass::index(); $this->type = $modelClass::type(); } $commandConfig = $db->getQueryBuilder()->build($this); return $db->createCommand($commandConfig); } /** * Executes query and returns all results as an array. * @param Connection $db the DB connection used to create the DB command. * If null, the DB connection returned by [[modelClass]] will be used.
* @param Connection $db the database connection used to execute the query. * If this parameter is not given, the `elasticsearch` application component will be used. * @return array the query results. If the query results in nothing, an empty array will be returned. */ public function all($db = null) { $result = $this->createCommand($db)->search(); if ($result === false) { throw new Exception('Elasticsearch search query failed.'); } if (empty($result['hits']['hits'])) { return []; }
* @param Connection $db the DB connection used to create the DB command. * If null, the DB connection returned by [[modelClass]] will be used. * @return array the query results. If the query results in nothing, an empty array will be returned. */ public function all($db = null) { return parent::all($db); } /** * Converts found rows into model instances * @param array $rows * @return array|ActiveRecord[]
} /* @var $objects \crimea\search\models\catalog\Object[] */ $objects = \crimea\search\models\catalog\Object::find() ->nearLocation($location, '10km') ->limit(10000) ->all(); $data = []; $excludedCategories = [\crimea\catalog\Plugin::getInstance()->getTransportAutostationCategoryId(), 26, 114, 110]; $onlyFromCategories = [];
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
/** * @param $id * @return int */ public function run($id) { return $this->createApp($this->getAppConfig($id))->run(); } }
$config = ArrayHelper::merge( FileHelper::requireFile($root . '/config/project.php'), FileHelper::requireFile($root . '/config/project-local.php') ); $project = new Project($config); $project->run('frontend');
$_GET = [ 'slug' => 'turstoyanka-shkolnaya-polyana', 'id' => '606', ];