@@ -19,7 +19,7 @@ Main features:
19
19
> [ !IMPORTANT]
20
20
> Require PHP 8.0+ and Elasticsearch 8+.
21
21
22
- Works with ** Elasticsearch 7** as well but is not officially supported by Elastica 8. Use with caution.
22
+ Works with ** Elasticsearch 7** as well, but is not officially supported by Elastica 8. Use with caution.
23
23
24
24
Version 2+ does not work with ** OpenSearch** anymore due to restrictions added by Elastic on their client.
25
25
@@ -249,7 +249,9 @@ Then configure the bundle:
249
249
# config/packages/elastically.yaml
250
250
elastically:
251
251
connections:
252
+ # You can create multiple clients
252
253
default:
254
+ # Any Elastica option works here
253
255
client:
254
256
hosts:
255
257
- '127.0.0.1:9200'
@@ -272,6 +274,10 @@ elastically:
272
274
273
275
# If you want to add a prefix for your index in elasticsearch (you can still call it by its base name everywhere!)
274
276
# prefix: '%kernel.environment%'
277
+
278
+ # Use HttpClient component
279
+ transport_config:
280
+ http_client: 'Psr\H ttp\C lient\C lientInterface'
275
281
` ` `
276
282
277
283
Finally, inject one of those service (autowirable) in you code where you need
@@ -340,8 +346,8 @@ JoliCode\Elastically\Client:
340
346
$config:
341
347
hosts:
342
348
- '127.0.0.1:9200'
343
- transport_client :
344
- client : '@my_custom_psr18_client' # An instance of Symfony \C omponent \H ttpClient \P sr18Client (Or any PSR 18 compliant one)
349
+ transport_config :
350
+ http_client : 'Psr \H ttp \C lient \C lientInterface'
345
351
` ` `
346
352
347
353
See the [official documentation on how to get a PSR-18 client](https://symfony.com/doc/current/http_client.html#psr-18-and-psr-17).
@@ -440,7 +446,6 @@ $factory = new Factory([
440
446
441
447
- some "todo" in the code
442
448
- optional Doctrine connector
443
- - better logger - maybe via a processor? extending _log is supposed to be deprecated :(
444
449
- extra commands to monitor, update mapping, reindex... Commonly implemented tasks
445
450
- optional Symfony integration :
446
451
- web debug toolbar!
0 commit comments