A Laravel package that maps Eloquent models to Elasticsearch types for easy indexing and searching.
Elasticquent is a Laravel package that maps Eloquent models to Elasticsearch types, enabling seamless indexing and searching of database records. It solves the problem of integrating Elasticsearch's powerful search capabilities with Laravel's Eloquent ORM without requiring low-level Elasticsearch queries. Developers can index models, perform searches, and retrieve results using familiar Eloquent syntax.
Laravel developers who need to add advanced search functionality to their applications using Elasticsearch. It's particularly useful for those already using Eloquent models and wanting to avoid writing raw Elasticsearch queries.
Elasticquent provides a clean, Eloquent-like interface for Elasticsearch, reducing the learning curve and boilerplate code. It offers flexibility with custom mappings and search options while maintaining compatibility with Laravel's ecosystem and collections.
Maps Laravel Eloquent models to Elasticsearch types
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides familiar Eloquent methods for indexing and searching, such as Book::search('Moby Dick') and $books->addToIndex(), reducing the learning curve for Laravel developers.
Supports bulk indexing with addAllToIndex(), collection indexing, and custom document data via getIndexDocumentData(), allowing tailored indexing strategies.
Offers simple term search, query-based search with searchByQuery(), and raw Elasticsearch queries via complexSearch(), enabling complex search implementations.
Returns results as Eloquent collections with added Elasticsearch metadata like totalHits() and documentScore(), integrating seamlessly with Laravel's collection methods.
The package does not automatically sync database changes to Elasticsearch; developers must explicitly call indexing methods, which can lead to data staleness if not managed properly.
Setting up custom analyzers and mappings requires a good understanding of Elasticsearch concepts, as highlighted in the README's requirement for basic Elasticsearch knowledge.
The README mentions that tests mocking ES API calls are needed and features are on a roadmap, indicating potential instability or incomplete features.