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

Elasticsearch Laravel Package

pdphilip/elasticsearch

Laravel Eloquent-style ORM for Elasticsearch. Use familiar models and query builder methods to create, update, paginate, delete, and run ES searches: term/phrase, match, fuzzy, geo distance, highlighting, and more—designed to feel native in Laravel.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Full-text search & analytics roadmap: Accelerate development of search-heavy features (e.g., e-commerce product search, content discovery, or user activity logs) by leveraging Elasticsearch’s capabilities without sacrificing Laravel’s Eloquent familiarity.
  • Build vs. buy: Buy—this package eliminates the need to build custom Elasticsearch integrations from scratch, reducing technical debt and maintenance overhead. Ideal for teams lacking Elasticsearch expertise.
  • Use cases:
    • Advanced search: Replace SQL LIKE queries with fuzzy, phrase, or geo-distance searches (e.g., "Find users within 10km of New York").
    • Scalable analytics: Offload aggregations (e.g., "Top 10 most active users by region") from SQL databases to Elasticsearch.
    • Hybrid relationships: Query SQL models and Elasticsearch models in a single request (e.g., UserLog::with('user')->whereGeoDistance(...)).
    • Real-time indexing: Sync critical data (e.g., logs, profiles) to Elasticsearch via Eloquent’s create(), update(), or delete() methods.
    • Migrations & re-indexing: Automate schema changes with the elastic:re-index command, reducing downtime for production updates.

When to Consider This Package

Adopt this package if:

  • Your Laravel app requires full-text search, fuzzy matching, or geo-spatial queries beyond SQL’s capabilities.
  • You need scalable analytics (e.g., aggregations, nested data queries) without overloading your primary database.
  • Your team prefers Eloquent syntax for Elasticsearch operations (e.g., Model::searchTerm('query')->get()).
  • You’re using Laravel 10–13 and need active maintenance (unmaintained versions exist for older Laravel).
  • You want to avoid reinventing Elasticsearch integrations (e.g., no need to manually map queries to Elasticsearch DSL).

Look elsewhere if:

  • You’re on Laravel <10 and need long-term support (consider forking or using an older version).
  • Your use case is simple keyword search—SQL’s LIKE or Laravel Scout’s basic implementations may suffice.
  • You require Elasticsearch’s advanced features (e.g., ML, cross-cluster search) not covered by this package (e.g., custom DSL queries).
  • Your team lacks Elasticsearch infrastructure (this package assumes you’ve already set up Elasticsearch clusters).
  • You need real-time sync between SQL and Elasticsearch (consider ElasticLens for hybrid setups).

How to Pitch It (Stakeholders)

For Executives: "This package lets us deliver Google-level search and analytics in our Laravel app without hiring Elasticsearch experts. By integrating Elasticsearch directly into Eloquent, our dev team can build features like product search, user activity dashboards, or location-based recommendations faster and with less risk than custom solutions. For example, we can replace slow SQL queries with near-instant Elasticsearch results—critical for scaling user growth. The package also automates tedious tasks like re-indexing, reducing operational overhead. Upfront cost: minimal (Elasticsearch hosting); ROI: immediate for search-heavy features."

For Engineers: *"This is Eloquent for Elasticsearch—no more writing raw Elasticsearch queries or context-switching between SQL and search APIs. Key benefits:

  • Familiar syntax: Use Model::searchTerm(), whereGeoDistance(), or whereFuzzy() just like Eloquent.
  • Hybrid queries: Join SQL and Elasticsearch models in one query (e.g., UserLog::with('user')->where('status', 1)).
  • Automated migrations: The elastic:re-index command handles schema changes safely, even in production.
  • Performance: Offload complex searches/aggregations from PostgreSQL/MySQL to Elasticsearch.
  • Maintenance: Actively developed for Laravel 10–13, with clear upgrade paths. Tradeoff: You’ll need to manage Elasticsearch infrastructure, but the package handles the Laravel integration seamlessly."*
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests