Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Elasticsearch Bundle Laravel Package

gbourgeat/elasticsearch-bundle

A Symfony bundle for integrating Elasticsearch into your PHP applications, providing configuration, service wiring, and convenient tooling for indexing and querying Elasticsearch from Symfony projects.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Framing correction up front: this package is a Symfony bundle, not a Laravel package, despite how it was filed. It is a PHP 7.2-targeted fork in the ONGR ElasticsearchBundle lineage — annotation-driven document mapping, a Symfony DI compiler pass, and bin/console index commands. There is no ServiceProvider, no publishable config, no Artisan surface. That single fact is the dominant input to every section below.

  • Architecture fit: Weak for our stack. The bundle's value lives almost entirely in Symfony-specific machinery — annotation document mapping, DI service decoration, repository/manager abstractions, and console commands. In Laravel we would consume a fraction of that (the document-to-array serializer, alias/manager ergonomics) while inheriting full Symfony coupling. The underlying transport is elasticsearch/elasticsearch (elasticsearch-php), which we can bind directly in ~100 lines. We would be paying for an integration layer we cannot use.
  • Integration feasibility: Technically possible — a Laravel service provider can boot symfony/dependency-injection and symfony/config — but this is a known anti-pattern. It imports a second DI container into the application, gives us two competing configuration systems, and makes container resolution/debugging materially harder. Cost/benefit is negative. Not recommended.
  • Technical risk: High.
    • Abandonment profile: 0 stars, 0 dependents, score 0, single maintainer, no release cadence, no security response path. Upstream ONGR is itself discontinued; the maintained successor path is the official elastic/elasticsearch-php client (v8+) plus a purpose-built Laravel driver.
    • Runtime pin: "for php7.2" — PHP 7.2 reached EOL November 2019. Adopting this into a PHP 8.2/8.3 Laravel app requires a fork-and-patch effort we would own indefinitely, on day one.
    • Elasticsearch server drift: ONGR-era forks target ES 6.x/7.x client semantics. ES 8 defaults TLS and security on, removes mapping types, and changes _doc API surface — silent incompatibilities are expected, not hypothetical.
    • Supply chain: no CVE path, no dependency audit history, no maintainer succession plan. This package will not clear a standard third-party risk gate.
  • Key questions to resolve before any decision:
    1. Which exact elasticsearch/elasticsearch client major does this fork pin, and which ES server majors does that client support?
    2. Is the actual requirement full-text search with facets/aggregations, or simple filtering? If the latter, Laravel Scout with a database driver or a thin client wrapper wins outright and this package is irrelevant.
    3. Is any part of our estate actually on Symfony + PHP 7.2 (legacy in-place), or is everything Laravel? This flips the recommendation from "do not adopt" to "adopt behind an interface, with an exit plan."
    4. Who is the named individual accountable for patching this for PHP 8.x and ES 8 if we adopt? A team name is not an answer.
    5. What are our index volume, reindex latency budget, and relevance-quality bar? Those — not the bundle — determine whether the feature is even viable.

Integration Approach

  • Stack fit:
    • Laravel (our stack): Do not adopt. Use elastic/elasticsearch-php v8 behind an internal SearchGateway interface, or laravel/scout with an Elasticsearch driver if the requirement is document search with light filtering. We will write less glue than integrating the Symfony bridge would cost.
    • Symfony on PHP 7.2 (if any legacy surface exists): the bundle is a legitimate drop-in and its annotation-mapping/repository layer saves real time — but only as a quarantined, temporary dependency with a scheduled removal.
  • Migration path:
    1. Define the interface first — SearchGateway with index, bulkIndex, delete, search, and reindexByAlias. This is the load-bearing decision; it makes build-vs-adopt reversible.
    2. Implement the interface over elasticsearch-php directly (recommended) or, in the legacy-Symfony case only, as a thin adapter over the bundle's repositories.
    3. Port the genuinely reusable semantics into our own thin package: index alias management (write alias + read alias), a document serializer, and search:reindex / search:index Artisan commands. This is roughly a week of engineering and eliminates the dependency entirely.
  • Compatibility: Hard pins required — PHP 7.2 and a specific ES client major. Any PHP 8.x project must fork. Conflicts with modern symfony/* component constraints are likely in a monorepo, and Composer resolution fights are a realistic outcome.
  • Sequencing:
    1. Day 1–2 spike: stand up ES 8 in Docker, attempt to drive it through this bundle's pinned client, and document the gap. This answers the risk question cheaply and concretely.
    2. Decide build vs. adopt against the interface above — with the default being build (thin client wrapper).
    3. Abstract before integrate. Never let the bundle's types (annotations, manager classes) leak into application or domain code.
    4. CI against a real ES container (Testcontainers or a compose service) before any production indexing code lands. Mocked Elasticsearch hides mapping and alias failures.
    5. Backfill via alias swap: index into a new index, validate document counts, atomically repoint the read alias, retain the old index for rollback.

Operational Impact

  • Maintenance: Full ownership transfers to us on day one. No upstream fixes means every ES server upgrade, PHP upgrade, and security advisory becomes our ticket. Budget ~10–15% of one engineer steady-state for fork maintenance, with spikes during any ES major upgrade.
  • Support: None. No maintainer responsiveness, no deprecation policy, no community to escalate to. Internal runbooks and a named internal owner are mandatory. Expect vendor/security review to flag this as unsupported third-party software — brief them ahead of time rather than have it surface late in the release gate.
  • Scaling: The bundle is a thin persistence layer; it neither constrains nor enables scale. Scaling lives in mapping design (keyword vs. text, doc_values), query shape, shard count, and bulk batch sizing. The bundle does provide bulk indexing and index/alias management — the minimum needed. Watch for unbounded annotation scanning at Symfony container compile time as document count grows (not our concern on Laravel, but relevant to the legacy path).
  • Failure modes to instrument explicitly:
    • Alias swap failure — read alias left pointing at a half-populated index. Mitigate with count validation before repoint and a manual approval gate.
    • Mapping conflict on reindex — new field types rejected by ES; only caught by indexing real data, never by unit tests.
    • Client/server version mismatch — silent header / Content-Type rejections on ES 8 presenting as opaque 406s.
    • Zero-document index — bulk requests return HTTP 200 with per-item failures. If we only check status codes we ship an empty index. Must parse items[].status.
    • Container compile failure on a PHP/runtime bump — blocks deploy entirely, not just the search feature, in the Symfony path.
    • Dependency resolution deadlock in a monorepo where another package needs newer symfony/*.
  • Ramp-up: For a Symfony engineer, roughly half a day to productivity on the annotation-mapping and repository idioms. For a Laravel team, expect 2–4 days of friction fighting two DI containers and unfamiliar annotation configuration — cost with no residual value once a native driver replaces it. Documentation is sparse, forks-of-forks often ship stale or absent docs, and we should plan on reading the source directly. Estimate the total ramp-up as sunk, not amortized.

Bottom line: Do not adopt for a Laravel stack. The fork's value is locked behind Symfony idioms, and its abandonment profile (0 stars, 0 dependents, score 0, PHP 7.2 pin, discontinued lineage) makes it a liability rather than an accelerant. The correct move is a thin, owned wrapper over the official elastic/elasticsearch-php v8 client behind an internal SearchGateway interface — a week of work that survives the PHP 8 and ES 8 upgrade paths. If any Symfony-on-7.2 legacy surface genuinely exists, treat the bundle as a time-boxed, quarantined accelerant with a named owner and a documented exit ticket already filed.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource