ongr/connections-bundle
ONGR Connections Bundle integrates Elasticsearch connection management into Symfony, letting you configure clients, register connections as services, and inject them through the dependency injection container for clean, reusable search infrastructure.
This bundle is archived and is part of the retired ONGR platform. Treat it as legacy code you are adopting, not as a modern dependency. The published line is 0.8.x (latest: 0.8.1), and 0.8.1 is a dependency-constraint release only — it bumps the required ongr/elasticsearch-bundle to ~0.9. There are no new features and no deprecations to plan around. Before anything else:
0.8.x line targets Symfony 2.x and PHP 5.5/5.6-era APIs, and 0.8.1 explicitly requires ongr/elasticsearch-bundle: ~0.9. Do not expect it to install on Symfony 4/5+, PHP 7.4+, or PHP 8. If your project is not already on that stack, stop here.
composer require "ongr/connections-bundle:0.8.1" "ongr/elasticsearch-bundle:~0.9"
ONGR\ConnectionsBundle\ONGRConnectionsBundle in AppKernel (or bundles.php), then import @ONGRConnectionsBundle/Resources/config/services.yml if your app doesn't auto-load it.vendor/ongr/connections-bundle/Resources/config/*.yml (service/command wiring) and Command/ — that is where the actual contracts live.--dry-run/verbose mode first, confirm the pipeline resolves both endpoints, then run it for real against a throwaway index.If you are starting a greenfield project, the only correct "getting started" step is: do not start with this bundle. Use ongr/elasticsearch-bundle directly (also archived but better documented) or a current Elasticsearch client and write your own sync command.
Connection as a configuration unit. Each connection is defined under the bundle's connections config key with a source service, a target service, and a pipeline. Keep one connection per source→target pair; you will spend less time debugging when you can name the failing connection in a log line.
ongr_connections:
connections:
product_sync:
source: app.doctrine.product_provider
target: app.elasticsearch.product_indexer
pipeline: product_pipeline
Pipeline as the transformation seam. Treat the pipeline as the place where extraction, mapping, and indexing happen, and keep business logic out of the bundle's service definitions. In practice you implement small services that conform to the imports the bundle pulls in (an extractor, a transformer, an indexer) and point the pipeline at them. This is the extension point the bundle was designed around — use it, rather than subclassing the bundle's internal classes.
Drive syncs from console, not from HTTP. The bundle's value is its sync commands. Wire them into cron:
app/console ongr:connections:sync product_sync --env=prod
and into deployment (full reindex) versus incremental (schedule delta syncs). Always have a full-sync path that can be re-run idempotently.
Treat the ESB coupling as part of your API. Because 0.8.1 pins ongr/elasticsearch-bundle ~0.9, the indexer/target services you configure are ESB 0.9 services, not modern Elasticsearch client objects. When you wrap them in your own services, wrap behind your own interface so a future replacement of ESB doesn't ripple through your pipeline code.
Event hooks for side effects. If the bundle dispatches sync lifecycle events, hook them for cache invalidation, metrics, or alerting rather than editing bundle internals. Because the code is abandoned, event wiring is safer to keep in your services than in the bundle.
Dependency injection overrides. When you need to change behavior, prefer defining your own service and referencing it in config instead of overriding the bundle's service id. Overriding internal ids breaks on any patch and there will be no upstream fixes.
Integration tip — test with a disposable index. Point the target at a --suffix-able index name per environment so CI can run syncs without touching production. The bundle has no concept of environments; build that in your app config.
elasticsearch-bundle ~0.9. That means upgrading the bundle can force an ESB upgrade (and vice versa). Pin both, commit the lockfile, and expect a resolver conflict if any other package wants a different ESB range.elasticsearch-php and Symfony 2.x APIs. A modern Doctrine DBAL, newer Elasticsearch client, or PHP 7+ runtime will fail in ways that look like bundle bugs but are version skew. Check composer.json in the vendor directory before debugging anything else.Resources/config and command classes; treat the source as the spec. Release notes are one line long — read the commit, not the changelog.-vvv and watch container compilation, not just the command output — most "nothing happened" issues are a misconfigured service id silently resolved to a stub.How can I help you explore Laravel packages today?