illuma-law/scout-lunr
Laravel Scout driver that brings Lunr-powered full-text search to Eloquent models, letting you index and query records locally without external search services while using Scout’s familiar model APIs.
Architecture fit: illuma-law/scout-lunr is a Laravel Scout search engine driver backed by Lunr (client-side/JS-style full-text search) running on a Cloudflare Worker. Architecturally it occupies the same slot as Scout's official drivers (Algolia, Meilisearch, Typesense, Database) — it plugs into laravel/scout via a service provider and driver registration, so it's framework-idiomatic rather than an invasive fork. The split architecture (PHP package + separately deployed Cloudflare Worker) is the key structural decision: the PHP side owns config and query building, the Worker owns index storage and search execution. That means this package is effectively a client SDK plus a query builder — the actual search runtime lives outside the application's deployment boundary.
Integration feasibility: Installation is conventional (Composer require, vendor:publish for config). The declared support matrix (Laravel 12–13, PHP 8.2–8.5) is current and sensible, and the expanded test matrix is a positive maturity signal for a v0.x package. Realistic effort is low-to-moderate on the Laravel side, but the Worker deployment is the actual integration cost and is explicitly out of scope of the package ("deployed and configured separately"). That is the single largest planning unknown.
Technical risk:
Key questions:
Stack fit: Requires Laravel 12+ and PHP 8.2+. This narrows applicability — any application on Laravel 10/11 is excluded, and the release notes give no indication of backward-compat branches. Scout is already a common Laravel dependency, so teams using Scout's database driver can swap drivers with moderate effort, assuming query features do not exceed what Lunr supports (no typo tolerance tuning comparable to Algolia, no facets/geo unless the builder exposes them). Confirm that Scout features in use (pagination, soft deletes, where clauses, custom indexes) are covered.
Migration path: Recommended sequencing:
Because there is no prior implementation in this codebase, this is a greenfield evaluation rather than a migration. That lowers switching cost but also means no in-house operational knowledge exists yet.
Compatibility: The published support matrix is internally consistent with current framework and PHP releases. The unstated compatibility axis is the Worker runtime — it evolves independently and is not covered by the Composer constraints, so composer update will not catch a Worker-side incompatibility.
Sequencing: Treat Worker deployment and PHP integration as two separate workstreams with a gate between them. Do not commit to a production date until the Worker is deployed, a representative index is built, and failure-mode behavior is observed under induced Worker outage. Budget for a fallback driver to remain configured during the evaluation window.
Maintenance: Two artifacts to maintain (Composer dependency plus a deployed Worker) plus a version-pairing contract that is currently undocumented. Pre-1.0 status means upgrade friction is likely; pin the package to an exact version and review each release's notes for breaking changes. The small maintainer base raises the probability of stalled releases; have an exit plan (driver abstraction) rather than assuming long-term support.
Support: Upstream support is best-effort open source from a single organization. Internal supportability depends on whether the team can read and modify both the PHP driver and the Worker code. If the Worker is opaque or not self-hostable, the team's ability to diagnose production search failures is materially limited. Assign an internal owner before adoption.
Scaling: Two independent scaling surfaces. The Laravel side scales trivially (HTTP client). The Cloudflare side inherits Workers' request and CPU-time limits, which matter because Lunr index construction/serving can be CPU-intensive; large corpora may hit per-request CPU ceilings. Index size also has memory implications inside a Worker. Validate against realistic corpus size and query concurrency early — this is the most likely place the design fails at scale. Also assess per-request cost and Cloudflare plan limits if traffic is high.
Failure modes to plan for:
Add monitoring on the HTTP boundary (latency, error rate, payload size) and alerting on indexing lag.
Ramp-up: Low for a Laravel developer to install and configure (standard Composer + artisan flow). Moderate for the engineer owning the Worker deployment, index lifecycle, and failure handling — that person needs Cloudflare Workers familiarity plus an understanding of Lunr indexing internals. Realistic estimate: one to two days for a spike, one to two weeks for a production-grade integration including failure handling, monitoring, and rebuild tooling. Document the Worker deployment as code (IaC) so recovery does not depend on one person's console knowledge.
Recommendation: Viable for internal or low-criticality search on Laravel 12+ where a self-managed, low-cost index is attractive. Not yet advisable for a business-critical search path without the Worker deployment proven in a staging environment, an explicit version-pairing policy, and a fallback driver configured. Re-evaluate at v0.3–v1.0 or once the client/Worker compatibility contract is documented.
How can I help you explore Laravel packages today?