Error Info: Array ( [0] => 42883 [1] => 7 [2] => ERROR: function similarity(character varying, unknown) does not exist LINE 1: select word, similarity(word, $1) as sml from search_lexicon... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. )
in /var/www/astra_axoft/data/www/astralinux.axoft.ru/core/vendor/yiisoft/yii2/db/Command.php at line 1302
$exceptionClass = '\yii\db\Exception'; foreach ($this->exceptionMap as $error => $class) { if (strpos($e->getMessage(), $error) !== false) { $exceptionClass = $class; } } $message = $e->getMessage() . "\nThe SQL being executed was: $rawSql"; $errorInfo = $e instanceof \PDOException ? $e->errorInfo : null; return new $exceptionClass($message, $errorInfo, $e->getCode(), $e); } /** * Returns a value indicating whether a SQL statement is for read purpose. * @param string $sql the SQL statement * @return bool whether a SQL statement is for read purpose. */ public function isReadQuery($sql) {
} else { $this->pdoStatement->execute(); } break; } catch (\Exception $e) { $rawSql = $rawSql ?: $this->getRawSql(); $e = $this->db->getSchema()->convertException($e, $rawSql); if ($this->_retryHandler === null || !call_user_func($this->_retryHandler, $e, $attempt)) { throw $e; } } } }
$this->prepare(true); try { $profile and Yii::beginProfile($rawSql, 'yii\db\Command::query'); $this->internalExecute($rawSql); if ($method === '') { $result = new DataReader($this); } else { if ($fetchMode === null) { $fetchMode = $this->fetchMode;
* @return array all rows of the query result. Each array element is an array representing a row of data. * An empty array is returned if the query results in nothing. * @throws Exception execution failed */ public function queryAll($fetchMode = null) { return $this->queryInternal('fetchAll', $fetchMode); } /** * Executes the SQL statement and returns the first row of the result. * This method is best used when only the first row of result is needed for a query. * @param int $fetchMode the result fetch mode. Please refer to [PHP manual](https://secure.php.net/manual/en/pdostatement.setfetchmode.php)
$words = explode(' & ', $search); foreach ($words as $word) { $result1 = []; $word = trim($word, '\''); $ql = 'select word, similarity(word, :word) as sml from search_lexicon where word % :word order by sml desc limit ' . $this->getLexiconLimit(); $result = Yii::$app->db->createCommand($ql, [':word' => $word])->queryAll(); if (ArrayHelper::getValue($result, '0.sml') != 1) { $q = implode(' ', ArrayHelper::getColumn($result, 'word')); $result1[] = $this->plainTsQuery($q, $this->getDict(), false);; } else { $result1[] = null; }
$result = Yii::$app->db ->createCommand('select plainto_tsquery(:dict, :q)', [':dict' => $dict, ':q' => $q]) ->queryOne(); $search = ArrayHelper::getValue($result, 'plainto_tsquery'); if ($trgm) { return $this->getTrgm($search); } $search = explode(' & ', $search); $search = array_unique($search); if ($this->operatorOr) { $search = implode(' | ', $search);
$query->addSelect(['*', $this->selectTsRank()]); $query = $this->whereRank($query); $q = $this->plainTsQuery($str, 'russian', false); $tg = $this->plainTsQuery($str); if (!$tg) { $query->addParams([ ':q' => $q, ':qTg' => $q, ]);
*/ public function find($query, $object = null, $options = []) { if (!empty($object)) { $object = (array)$object; } return $this->getActiveAdapter()->setOptions($options)->search($query, $object); } /** * Сформировать модель данных для записи в индекс. * * @param ActiveRecord $model модель документа.
* * @return mixed * @throws \Exception */ public function getItems() { $query = Yii::$app->search->find($this->getSearchQ(), $this->getSearchTag()); $countQuery = clone $query; $pages = Yii::createObject([ 'class' => Pagination::class, 'totalCount' => $countQuery->count(), 'pageParam' => 'currentPage',
* @return array the array representation of the object */ public function toArray(array $fields = [], array $expand = [], $recursive = true) { $data = []; foreach ($this->resolveFields($fields, $expand) as $field => $definition) { $attribute = is_string($definition) ? $this->$definition : $definition($this, $field); if ($recursive) { $nestedFields = $this->extractFieldsFor($fields, $field); $nestedExpand = $this->extractFieldsFor($expand, $field); if ($attribute instanceof Arrayable) { $attribute = $attribute->toArray($nestedFields, $nestedExpand);
* * @return mixed */ protected function prepareData() { $layout = $this->controller->getLayoutDataRender(); $data = Yii::createObject($this->getModelClass())->toArray(); return ArrayHelper::merge($layout, $data, ['firstLoad' => true]); } /** * Выполнить действие. *
* Выполнить действие. * * @return string */ public function run() { return $this->controller->render($this->getTemplate(), $this->prepareData()); } }
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this) . '::run(), invoked by ' . get_class($this->controller), __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } if ($this->beforeRun()) { $result = call_user_func_array([$this, 'run'], $args); $this->afterRun(); return $result; } return null;
} $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();
$modulesConfig = Yii::createObject(ConfigComponent::class)->execute('frontend'); $config = ArrayHelper::merge($modulesConfig, $config); $config = ConfigModule::configRemove($config); $application = new Application($config); $application->run();
$_SESSION = [ '__flash' => [], 'utm' => '', 'params' => false, ];