Closed jmsche closed 1 year ago
Hmm, the @
in front of the transport value is suspicious.
And I checked, and I totally forgot to replace the transport by a Reference
if it exist.
Can you try something like :
diff --git a/src/Bridge/Symfony/DependencyInjection/ElasticallyExtension.php b/src/Bridge/Symfony/DependencyInjection/ElasticallyExtension.php
index 9e4e216..1a8e3db 100644
--- a/src/Bridge/Symfony/DependencyInjection/ElasticallyExtension.php
+++ b/src/Bridge/Symfony/DependencyInjection/ElasticallyExtension.php
@@ -64,6 +64,9 @@ class ElasticallyExtension extends Extension
$container->setDefinition("elastically.{$name}.result_set_builder", $resultSetBuilder);
$client = new ChildDefinition('elastically.abstract.client');
+ if (array_key_exists('transport', $config)) {
+ $config['transport'] = new Reference($config['transport']);
+ }
$client->replaceArgument('$config', $config['client']);
$client->replaceArgument('$resultSetBuilder', new Reference("elastically.{$name}.result_set_builder"));
$client->replaceArgument('$indexNameMapper', new Reference("elastically.{$name}.index_name_mapper"));
Note: you must relove the leading @
I fixed the issue in #140 by using @lyrixx patch & recommendation. As he said, using @
won't work, but even by removing it, it wouldn't work without the patch he shared.
If you have some time could you check / test the PR ?
Hi,
I'm currently testing the new Symfony bundle, and I'm facing this issue when trying to index data:
When I dump() the $transport before the if() statement, I get a string instead of a service:
@JoliCode\Elastically\Transport\HttpClientTransport
Here is my (truncated) Elastically config:
Did I miss something?