floriansemm/solr-bundle
A Symfony bundle that integrates Apache Solr search, offering configurable clients and services for indexing documents, building queries, and managing Solr connections so applications can add fast, scalable full-text search with minimal setup.
Architecture fit — poor to marginal. floriansemm/solr-bundle is a Symfony bundle, not a Laravel package. Its architecture assumes:
Bundle, Extension, CompilerPass) with bundle config merged from config.ymlpostPersist/postUpdate/postRemove to keep the Solr index in syncLaravel has no bundle concept — its service-provider lifecycle, config repository, and container semantics differ enough that the package cannot be installed and used as-is. On the persistence side, Laravel's default ORM is Eloquent, not Doctrine, so the single most valuable feature (automatic index synchronization) has no out-of-the-box attachment point. The translatable value is narrow: the query-building abstraction, field mapping, and index/schema handling.
Integration feasibility — feasible only as a fork/extraction, not an adoption. A realistic path is to vendor the source and harvest the Solr client + query builder, discarding all Symfony and Doctrine glue. That is a day-to-two-day spike for a senior PHP engineer, contingent on the code compiling under a modern PHP runtime (see risk below). If the goal is simply "search in Laravel," better-supported options exist and should be evaluated first:
| Option | Fit | Notes |
|---|---|---|
solarium/solarium used directly in a ServiceProvider |
High | Actively maintained; you own the thin Laravel wrapper |
| Laravel Scout + a Solr engine driver | Medium–High | Idiomatic model indexing, but driver quality varies |
Fork solr-bundle and re-glue to Laravel |
Low–Medium | Highest effort, highest ongoing ownership cost |
Technical risk — high. Concretely:
Key questions for the spike:
Verdict: technically viable only as a source to mine, not as a dependency. The high "opportunity" score reflects a genuine gap (no first-class Solr integration for Laravel), but this package does not fill it.
Stack fit. This is a Symfony/Doctrine artifact landing in a Laravel/Eloquent stack — a two-layer mismatch (framework and ORM). Any integration plan must be explicit that we are reimplementing, not installing. Assume ~70% of the package's surface area is framework glue to be discarded and ~30% is transferable domain logic (query construction, field mapping, index operations).
Migration path. Recommended sequence for a fork-and-harvest approach:
packages/solr-search via a Composer path repository; keep MIT headers intact for attribution.Symfony\Component\* and Doctrine\* imports; isolate the Solr-facing classes behind a single namespace boundary.ServiceProvider — config published to config/solr.php, client bound as a singleton, connection params from env.observe/model events or, preferably, explicit index jobs dispatched to a queue. Do not rely on synchronous model hooks in the request path.Compatibility. Validate early and cheaply:
composer why-not php 8.2 style checks and a static analysis pass (PHPStan level 5) on the vendored code to size the patch surface.solr server image version in CI matches production (Solr major-version drift is a silent schema/handler mismatch risk).laravel-doctrine/orm) is already in the stack, the listener layer becomes partially reusable — verify before discarding it.Sequencing and gates. Timebox a 2-day spike with a hard go/no-go: (a) client layer separated, (b) one document indexed and one query returned against Solr 8+, (c) estimated patch count under a stated threshold. If the spike fails gate (b) or blows the patch budget, exit to Solarium-direct and stop spending. Do not run the fork and an alternative in parallel beyond the spike — the comparison is cheap, the dual maintenance is not.
Recommendation: treat solr-bundle as reference material for schema design and query patterns. Ship v1 on Solarium behind a Laravel service provider. Revisit the fork only if a specific capability (e.g., rich multi-field query DSL) demonstrably cannot be reproduced in a few days.
Maintenance — we own it entirely. With a 2018 release cadence and zero dependents, there is no upstream to absorb PHP/Solr upgrades. Budget recurring engineering time for: PHP minor-version compatibility, Solarium security patches, Solr server upgrades, and schema evolution. A forked codebase of this vintage realistically needs a maintenance window each quarter, not each year.
Support. No vendor, no active maintainer, no responsive issue tracker. Internal documentation of why we forked and what we changed becomes the only institutional knowledge — this must be written at fork time, not reconstructed later. Named ownership (one engineer, one backup) is mandatory for a fork; without it the code becomes load-bearing orphan infrastructure with a long tail of silent risk.
Scaling. The PHP layer is thin, so throughput is dominated by indexing strategy, not the package:
Failure modes. Enumerate these in the runbook:
| Failure | Symptom | Mitigation |
|---|---|---|
| Index drift (missed writes) | Search misses recent records, no error | Nightly reconciliation job; queue dead-letter alerting |
| Transaction/index mismatch | Record in DB, absent in Solr (or vice versa) | Index after commit only; idempotent reindex by ID |
| Solr unavailable | Search endpoint 5xx or timeout | Circuit breaker + graceful degradation to DB query |
| Schema/handler mismatch after Solr upgrade | Empty results, 400s on query | Pin Solr image version; contract tests in CI |
| Stale fork + PHP upgrade | Fatal errors on deploy | PHP version pinned in CI, upgrade as planned work |
| Config drift | Indexing silently targets wrong core | Config validation at boot; fail fast |
Two failure modes deserve emphasis as product risks rather than engineering ones: silent index drift (users lose trust in search before anyone notices) and Solr-downtime coupling (a search dependency taking down the storefront). Both argue for asynchronous indexing and a circuit-broken read path from day one — retrofitting either is expensive.
Ramp-up. Two distinct skill gaps: (1) Solr operations — schema design, analyzers, commit tuning, core management — which no PHP package removes and which the team likely lacks; (2) Symfony internals, needed only if we fork, since debugging the harvested code requires reading DI-era idioms. Budget for a Solr primer plus a documented schema decision record. If the team has no Solr operational experience, factor managed Solr (or a hosted search service) into the cost comparison — that decision likely dominates the build-vs-fork calculus more than the package choice does.
How can I help you explore Laravel packages today?