handcraftedinthealps/elasticsearch-dsl
A fork of ongr/elasticsearch-dsl for building Elasticsearch queries in PHP with a fluent DSL. It extends support to a wider range of Symfony (3.4 through 7.x) and Elasticsearch versions, and powers the handcraftedinthealps Elasticsearch bundle.
elasticsearch/elasticsearch client, (b) adopt this DSL behind an adapter, (c) adopt it directly in feature code. Option (c) is the one to avoid, and this package's profile is what makes that clear.^7.0, yet the release history shows explicit ES 8 support work (8.0.0), kNN search (8.2.0), runtime fields, and parent aggregations (8.3.0). That documentation gap is itself a decision input: someone must validate the 8.x path against the target cluster before it enters a roadmap commitment. Symfography version breadth (2.8–7.x) matters only if you consume the companion Symfony bundle; in Laravel, only the framework-agnostic query library is relevant.ongr-io/elasticsearch-dsl with ~21 stars and zero dependents is a maintainability question, not a capability question. It justifies a decision to vendor, pin, or isolate — and sets expectations for who patches it when upstream stalls. Recent releases (through mid-2025) mitigate the abandonment risk but don't eliminate it.Consider it when:
Look elsewhere when:
^7.0 ceiling is the conservative read.To executives: This is a small, MIT-licensed PHP library that lets engineers build Elasticsearch queries as structured, testable objects instead of hand-written JSON. It can shorten delivery on complex search features — faceted filtering, relevance tuning, admin search — and reduce the defect rate that comes from string-built queries. It carries no license cost and no procurement cycle. The caveat is durability: it is a community fork with minimal adoption, so we should treat it as a tactical accelerator, not a platform standard. Recommendation: approve a time-boxed pilot behind an internal adapter, with a documented exit path to the official client, rather than a broad rollout.
To engineering: Use it as a query-construction layer only — it builds request bodies and hands off to whatever transport client you already run; it owns no connections, retries, or cluster state. Installation is Composer-only with a small dependency tree, and the output is a plain array, so it composes with elasticsearch/elasticsearch or a Scout driver without ceremony. The Symfony compatibility story is irrelevant to Laravel — evaluate it as a framework-agnostic library and ignore the companion bundle. Two things need verification before commitment: whether the ES 8 support visible in the release notes is production-ready given the README still tops out at ^7.0, and how much surface area you'd actually use versus wrapping the official client yourselves. Budget a short spike against a real cluster, keep the dependency behind one internal interface, and treat every query class as something worth a unit test.
How can I help you explore Laravel packages today?