yii2-elasticsearch 2.1不使用AWS elasticsearch

时间:2018-05-14 19:46:06

标签: amazon-web-services elasticsearch yii2

我想将elasticsearch yii2组件与AWS elasticsearch服务一起使用。但这是不允许的。因为AWS elasticsearch在选择节点进行连接时没有提供[http] [publish_address]作为响应。而yii2-elasticsearch(2.1)只是丢弃任何这样的节点。

如果我错过了什么,还有其他办法吗?

以下是我的组件配置和错误。

'elasticsearch' => [
  'class' => 'yii\elasticsearch\Connection',
  'nodes' => [
    [
      'http_address' => 'end-point.es.amazonaws.com',
      'protocol' => 'https'
    ],
  ],
]

Stack trace:
#0 /var/www/html/staging/vendor/yiisoft/yii2-elasticsearch/Connection.php(190): yii\base\ErrorHandler->handleError(8, 'Undefined index...', '/var/www/html/s...', 190, Array)
#1 /var/www/html/staging/vendor/yiisoft/yii2-elasticsearch/Connection.php(155): yii\elasticsearch\Connection->populateNodes()
#2 /var/www/html/staging/vendor/yiisoft/yii2-elasticsearch/Connection.php(259): yii\elasticsearch\Connection->open()
#3 /var/www/html/staging/common/models/es/BaseModel.php(129): yii\elasticsearch\Connection->createCommand()
#4 /var/www/html/staging/common/models/es/BaseModel.php(134): common\models\es\BaseModel::deleteIndex()
#5 /var/www/html/staging/console/controllers/EsController.php(114): common\models\es\BaseModel::resetIndex()
#6 /var/www/html/staging/console/controllers/EsController.php(206): console\controllers\EsController->reindexInBulk(Array, '100')
#7 [internal function]: console\controllers\EsController->actionReindex()
#8 /var/www/html/staging/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#9 /var/www/html/staging/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#10 /var/www/html/staging/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('reindex', Array)
#11 /var/www/html/staging/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('reindex', Array)
#12 /var/www/html/staging/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('es/reindex', Array)
#13 /var/www/html/staging/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('es/reindex', Array)
#14 /var/www/html/staging/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#15 /var/www/html/staging/yii(31): yii\base\Application->run()
#16 {main}

1 个答案:

答案 0 :(得分:0)

看起来它试图删除不存在的索引。

SET @query = 'SELECT ....
WHERE location in ('+@location+') AND costcentre in ('+@costcentre+') AND drug_name in ('+@drug_name+') 

出现错误。