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 Query Builder Laravel Package

erichard/elasticsearch-query-builder

A fluent PHP query builder for Elasticsearch that lets you construct complex search queries through an elegant, chainable API instead of hand-writing JSON. A good fit for Laravel and standalone PHP projects that need readable, maintainable Elasticsearch DSL.

Deep Wiki
Context7

Product Decisions This Supports

  • Search feature delivery: Enables Laravel/PHP teams to express Elasticsearch queries through a fluent interface instead of hand-building nested arrays, reducing implementation time for filtered search, faceted navigation, sorting, pagination, and boolean query logic.
  • Roadmap sequencing: Supports incremental search improvements—dynamic filters, saved searches, admin search, multi-tenant query templates, and request-to-query translation—without committing to a full search platform or ODM.
  • Build vs. buy: A lightweight MIT-licensed dependency can replace a small internal query-builder layer. The trade-off is lower adoption risk mitigation: 39 stars and unknown repository metadata mean the team should wrap it behind an internal interface and retain a native-client fallback.
  • Use cases: Laravel API endpoints that translate user-selected filters into Elasticsearch queries; internal admin search; catalog/content discovery; reusable query templates across services; testable query construction separate from the Elasticsearch client.
  • Architecture decision: Encourages separating query definition from query execution, improving unit testing and consistency across endpoints. It is not an indexing, model-mapping, or full search-platform solution, so product scope should remain query construction.

When to Consider This Package

  • You already operate Elasticsearch and use the official PHP client, and need a readable, testable way to build non-trivial queries in Laravel/PHP services.
  • Search requirements include dynamic filters, nested boolean conditions, sorting, pagination, or reusable query patterns that would otherwise become brittle array-building code.
  • The team values a thin, framework-agnostic dependency over a full Laravel search integration, and can pin versions and validate compatibility with the Elasticsearch server and PHP client.
  • You can adopt it behind an internal adapter so query construction can be swapped or extended without leaking the package across the codebase.
  • Look elsewhere if you need Laravel-native integration, model mapping, index lifecycle management, Scout-style search, heavy aggregation/reporting coverage, enterprise support, or a large maintained community. Also look elsewhere if a time-boxed spike shows missing DSL coverage, unclear maintainership, or incompatibility with your Elasticsearch client version.

How to Pitch It (Stakeholders)

  • Executives: This is a low-cost MIT library that can accelerate delivery of search and filtering features while reducing custom query-building code. The main risk is low community adoption, so treat it as a tactical dependency, not a strategic platform, and mitigate with tests, version pinning, and an internal abstraction.
  • Engineering: It provides a fluent PHP API for constructing Elasticsearch queries, keeping search logic more readable and testable than raw arrays. Adopt it behind our own query-builder interface, add contract tests against supported Elasticsearch versions, verify DSL coverage, and keep a fallback to the official client.
  • Product: It supports faster iteration on search UX—dynamic filters, faceted navigation, saved searches, and admin tooling—without waiting for a larger search platform build. Start with a short spike on a real search flow, measure coverage and maintenance risk, then decide whether to standardize.
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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib