こんにちは、AWS にある ES indet に接続しようとしましたが、それでもエラーが発生します。
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
You have requested a non-existent service "es.managers.default".
ドキュメントで説明されているように、Conposer を使用してバンドルをインストールしました。次に、config.ylmに構成部分を追加しました
ongr_elasticsearch:
managers:
default:
index:
index_name: contents
hosts:
- https://search-***.es.amazonaws.com:443
mappings:
- StatElasticBundle
私は awsaccesskey と awssecretkey を持っていますが、それらをどこに置く必要があるのか わからないので、parameters.yml に aws_connection セクションを作成してロードしようとしました
次に、SymfonyBundle で接続を確立しようとし、バンドルを拡張するために Bundle->DepandencyInjection フォルダーにクラスを作成しました。ここでエラーが発生します。あなたの誰かが同じエラーに苦しんでいるかもしれませんか?手伝ってくれてありがとう。
Class StatElasticExtension extends Extension
{
const YAML_FILES = [
'parameters.yml',
'config.yml',
'services.yml'
];
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
foreach (self::YAML_FILES as $yml) {
$loader->load($yml);
}
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$serviceDefinition = $container->getDefinition('es.managers.default');
$awsConnections = $container->getParameter('aws_connections');
$elasticsearchClient = $this->getClient($awsConnections);
$serviceDefinition->replaceArgument(2, $elasticsearchClient);
}