pdphilip/elasticlens
ElasticLens brings Elasticsearch power to Laravel models with Eloquent-style queries. Define your own index models, mappings, and schema—no black box. Run phrase/term searches, filters, embedded fields, geo distance sorting, and pagination with fluent, readable APIs.
Architecture fit: The package's ground-up rewrite with typed signatures, error boundaries, and dedicated Elasticsearch CI testing significantly improves reliability and maintainability. Compatibility with Laravel 10-12 aligns with current ecosystem standards. Core indexing and observer systems now have clearer abstraction layers, reducing technical debt.
Integration feasibility: High for Laravel 10+ projects. Breaking changes are well-documented with explicit upgrade paths, but legacy code relying on getBase()/paginateBase() requires targeted refactoring. The new test suite reduces integration uncertainty.
Technical risk: Moderate. Breaking changes in model return types (viaIndex()->get() now returns base models directly) could introduce runtime errors if not addressed. New features like conditional indexing require careful configuration but have dedicated documentation. Elasticsearch dependency remains a critical external risk.
Key questions:
Stack fit: Excellent for Laravel 10-12 projects. Strong type hints improve IDE support and reduce runtime errors. The package's separation of base models vs. index values (get() vs getIndex()) aligns with Laravel's Eloquent patterns while providing explicit control over data hydration.
Migration path:
getBase()/paginateBase() calls with get()/paginate() for base modelsgetIndex()/paginateIndex() where explicit index data is neededMaintenance: Reduced long-term burden due to full test coverage and centralized documentation. Breaking changes are one-time fixes, but teams must monitor deprecation of legacy methods (getBase()/paginateBase()). Documentation updates are now versioned and publicly accessible.
Support: Clear upgrade guide and feature-specific docs reduce support overhead. Teams should prioritize training on conditional indexing and soft delete workflows to avoid misconfiguration. Elasticsearch dependency requires monitoring but is now explicitly called out in error boundaries.
Scaling: Rewritten core components show promise for better resource handling, but scaling depends on Elasticsearch cluster configuration. New error boundaries prevent cascading failures during indexing bursts. Load testing against target Elasticsearch tiers is recommended.
Failure modes: Improved error boundaries isolate failures (e.g., Elasticsearch downtime), but unhandled network issues may still disrupt indexing. Soft delete support reduces accidental data loss, but misconfigured exclusions could lead to stale index entries.
Ramp-up: Moderate initial learning curve for new API patterns (e.g., getIndex() usage), but comprehensive docs mitigate this. Teams with existing Elasticsearch experience will adapt quickly. Conditional indexing and soft delete features require deliberate configuration practice.
How can I help you explore Laravel packages today?