- Issue created by @josegracia
It would be a better idea to convert the query to use Drupal's database abstraction layer, with something like this:
$query = $database->select('search_api_stats') ->fields('search_api_stats', ['keywords']) ->addExpression('COUNT(*)', 'num') ->condition('s_name', $serverName) ->condition('i_name', $indexName) ->condition('keywords', '', '<>') ->groupBy('keywords') ->orderBy('num', 'DESC') ->range(0, $config['num_phrases']); $stats = $query->execute()->fetchAll(\PDO::FETCH_ASSOC);