Weave Code
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

Laravel Elasticsearch Laravel Package

designmynight/laravel-elasticsearch

Laravel package that lets you query Elasticsearch with Eloquent-style builders and get model instances back. Supports query/filter/postFilter, geo search, complex aggregations, and the scroll API for large result sets.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Search and Discovery Features: Accelerates development of high-impact search functionalities (e.g., e-commerce filters, content recommendations, or advanced analytics dashboards) by abstracting Elasticsearch complexity behind Laravel’s Eloquent API.
  • Roadmap Prioritization: Enables teams to deprioritize custom Elasticsearch integrations in favor of faster iteration, especially for MVP features or secondary search capabilities.
  • Build vs. Buy Decision: Validates using an open-source package over hiring Elasticsearch specialists or building in-house, reducing technical debt for non-core search features.
  • Use Cases:
    • Full-text search (e.g., documentation, articles, or user-generated content) with familiar Laravel syntax.
    • Aggregations and analytics (e.g., dashboards, reporting, or dynamic pricing) via nested aggregation queries.
    • Geo-based applications (e.g., location services, logistics, or local business directories) with built-in geo-filtering.
    • Large-scale data retrieval (e.g., paginated feeds, archival systems, or real-time logs) using Elasticsearch’s scroll API.
    • Migration strategies: Gradually replace SQL queries with Elasticsearch for read-heavy workloads without rewriting business logic.

When to Consider This Package

  • Adopt if:

    • Your Laravel application needs search or analytics but lacks dedicated backend resources to build a custom Elasticsearch integration.
    • You prioritize developer velocity over low-level Elasticsearch control (e.g., no need for raw DSL queries or advanced scripting).
    • Your use case fits Eloquent-like query patterns (e.g., filtering, aggregations, or geo-search) without requiring real-time database sync.
    • You’re using Elasticsearch 5.0+ and Laravel 6+, with compatibility for newer versions (e.g., Laravel 12).
    • You need mapping management (e.g., migrations, aliases, and rollbacks) as part of your deployment pipeline.
    • Your team is comfortable with Laravel’s Eloquent but lacks Elasticsearch expertise.
  • Look elsewhere if:

    • You require real-time synchronization between Elasticsearch and a relational database (this package treats Elasticsearch as a primary data source, not a sync layer).
    • Your queries demand complex scripting, non-Eloquent Elasticsearch features (e.g., ML, graph search, or security analytics), or custom analyzers.
    • You’re on an unsupported Elasticsearch version (e.g., <5.0) or an unsupported Laravel version (e.g., <6).
    • Your team has dedicated Elasticsearch experts who prefer raw clients (e.g., elasticsearch/elasticsearch PHP client) for full flexibility.
    • You need multi-tenancy isolation at the index level (this package uses a single index suffix by default).
    • Your application requires high-frequency writes with strict consistency guarantees (Elasticsearch is optimized for reads/search, not ACID transactions).

How to Pitch It (Stakeholders)

For Executives: "This package lets us deliver Elasticsearch-powered search and analytics without hiring specialized talent or building custom infrastructure. For example, we could launch a product recommendation engine or geo-location service in weeks instead of months, using the same Laravel tools our team already knows. It’s a low-risk, high-reward way to compete on search relevance, with minimal ongoing maintenance. The MIT license and active development ensure long-term viability, while the Eloquent integration reduces training costs. Let’s use this to accelerate feature delivery in [specific area, e.g., e-commerce, content discovery, or logistics]."

For Engineering Leaders: *"This package bridges the gap between Laravel and Elasticsearch by letting us query Elasticsearch using Eloquent syntax, which cuts development time by ~50%. Key benefits:

  • Familiar API: No need to learn Elasticsearch DSL—just use where(), aggregation(), or whereGeoDistance().
  • Built-in tooling: Handles mappings, aliases, and migrations via Artisan commands (e.g., make:mapping, migrate:mappings).
  • Performance: Optimized for large datasets with the scroll API and bulk operations.
  • Compatibility: Supports Elasticsearch 5.0+ and Laravel 6–12, with active maintenance. Tradeoff: Less control than raw Elasticsearch clients, but ideal for 80% of use cases. Recommended for search-heavy features where speed matters more than fine-grained tuning."*

For Developers: *"If you’ve ever dreaded writing Elasticsearch queries from scratch, this package lets you use Laravel’s Eloquent for search. Highlights:

  • Query Elasticsearch like SQL: Model::where('price', '>', 100)->get() works with Elasticsearch.
  • Aggregations made easy: Nested aggregation() calls replace complex JSON DSL.
  • Geo-search: Built-in whereGeoDistance() and whereGeoBoundsIn() for location-based apps.
  • Scroll API: Handle millions of records with generators (no memory issues).
  • Migrations: make:mapping and migrate:mappings automate index setup. Downside: Not for advanced Elasticsearch features, but perfect for CRUD-like search queries. Try it for your next search feature—it’s a game-changer."*
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope