imdhemy/berrylastic
Berrylastic is a Laravel/PHP package that simplifies integrating Elasticsearch into your applications, with a fluent query builder, model indexing, and configurable search support for building fast, scalable search experiences. It keeps search logic clean and idiomatic.
Architecture fit
The package targets a well-understood gap: keeping a search index (Elasticsearch/OpenSearch-style, given the match / multi_match / match_phrase query vocabulary) synchronized with Laravel's Eloquent layer. The value proposition is the standard Laravel "model as source of truth" pattern extended with search side effects — auto-index on create, auto-update on save, plus explicit on-demand indexing/updating for cases where event-driven sync is undesirable (bulk imports, backfills, seeders, console commands). This is architecturally coherent with Laravel's observer/event model and requires no application-layer restructuring.
Integration feasibility The feature surface is deliberately narrow and low-risk to trial: model-level configuration, model lifecycle hooks, and three query builders. There is no new infrastructure, no queue requirement stated, no schema/migration coupling. A single model can be instrumented first, making this a low-commitment spike.
Technical risk
This is a v1.0.0-alpha with an unusually thin feature description, and the gaps matter more than the features:
saveMany, mass updates, or queued batching. Mass-assignment and Model::query()->update() paths bypass model events entirely.deleted events remove documents, or how soft-deleting models should behave.match_phrase and multi_match behavior is entirely analyzer-dependent. Users may be forced to hand-manage mappings outside the package.bool composition. This is likely an insufficient primitive for any non-trivial search UI.v1.0.0.Key questions
forceDelete handled?bool composition?dry/disabled mode for tests and local environments, and how does it behave in CI without a live search cluster?Stack fit Native to Laravel conventions — Eloquent models, model events, config publishing. Fits a standard LAMP/Laravel stack with an existing or planned search cluster. It presumes the team already operates (or will operate) a search backend; the package does not abstract over backends or provide an embedded alternative.
Migration path Phased, reversible, and scoped to one model:
Compatibility Confirm Laravel and PHP version constraints before committing — alpha packages frequently pin narrowly, and this is the most likely source of an immediate blocker. Also verify the client library version against the target cluster version; that pairing, not the Laravel package version, usually drives incompatibility.
Sequencing Do the spike and the test-environment dry-run mode question first — if the package cannot be disabled cleanly in CI, the integration cost rises sharply and should be resolved before any application code depends on it.
Maintenance Adopting an alpha means accepting churn as a fixed cost. Budget for API-drift work at each minor release, and avoid spreading the package across many models early, since a breaking change scales with surface area. Pin the version explicitly — never a floating constraint — and treat upgrades as scheduled work, not opportunistic ones.
Support No stated maturity signals: no mention of a maintainer team, release cadence, or support window. The blast radius is limited — the package sits on the write path but is removable — however, a search cluster is often business-critical, so an abandoned alpha on a revenue-adjacent path is a real concern. Establish internal ownership before adoption; do not assume upstream support.
Scaling
The primary scaling risk is write amplification. Per-model-instance auto-indexing produces one cluster write per record save. Bulk importers, admin mass-edits, and data migrations can generate unbounded write bursts against the cluster, and — because Model::query()->update() bypasses model events — can also silently desynchronize the index. Absent documented bulk or queued paths, plan to disable auto-sync during bulk operations and follow with on-demand indexing. Query throughput is likely fine at the package's stated scope; the write path is the constraint.
Failure modes
DB::table() writes, or raw SQL leave stale documents. This is the highest-probability failure and the hardest to notice.match_phrase query against an unanalyzed or dynamically mapped field returns quietly wrong results rather than errors.saved plus created firing on the same operation can double-write if the package is not deduplicating.Ramp-up Low for a Laravel developer — the model trait plus three query builders is a short ramp, on the order of a day for the indexing/updating lifecycle and an hour for queries. The real learning cost is not the package but the surrounding search discipline: analyzers, mappings, relevance evaluation, and reindex operations. None of that is in scope here, so a team without prior search-cluster experience should not read "small API surface" as "small project."
Recommendation: Viable for a time-boxed spike and for internal, low-criticality search on a small number of models. Not yet appropriate for a primary search path or a high-write-volume model. Re-evaluate at beta or at the first release that documents queued/bulk indexing, delete handling, and a reindex strategy.
How can I help you explore Laravel packages today?