massive/search-bundle
Laravel bundle that adds a flexible, driver-based search layer to your app. Define searchable models and fields, run queries across multiple sources, and return consistent results with pagination and filtering—designed to be easy to integrate and extend.
@Index, @Searchable) for declarative indexing, which aligns with Laravel’s Eloquent model conventions (e.g., useAsPivot, casts). Custom field mappings can be implemented via Laravel’s service providers or package overrides.SearchEvent system allows intercepting queries, modifying results, or adding custom logic—directly translatable to Laravel’s service providers or event listeners (e.g., Illuminate\Events\Dispatcher).SearchManagerInterface, FieldEvaluator) enables partial adoption:
EventDispatcher with Laravel’s Dispatcher via a custom bridge.beberlei/doctrineextensions).| Risk Area | Mitigation Strategy |
|---|---|
| Symfony-Laravel Gap | Abstract Symfony-specific components (e.g., ContainerBuilder) behind interfaces. Use Laravel’s Illuminate\Contracts\Container\Container for DI. |
| Doctrine Dependency | Decouple metadata handling via Laravel’s model events (e.g., retrieved, saved) or custom annotations. |
| Elasticsearch 8+ | Leverage the bundle’s compatibility mode for Elasticsearch 7 client. Monitor for breaking changes in future versions. |
| Performance Overhead | Benchmark indexing/reindexing against Laravel Scout or raw Elasticsearch queries. Optimize via bundle’s partial reindexing features. |
| Learning Curve | Provide Laravel-specific docs (e.g., "How to use MassiveSearchBundle with Laravel Scout"). Highlight expression language as a key differentiator. |
de, en translations)? The bundle supports this natively.massive:search:reindex) be integrated into deployments? Should it run post-deploy or on-demand?Symfony\Component\DependencyInjection → Illuminate\Container.Symfony\Component\EventDispatcher → Illuminate\Events\Dispatcher.Symfony\Component\Console → Laravel’s Artisan (or custom wrapper).elastic/elasticsearch).Product model) and querying via the expression language.EventDispatcher with Laravel’s equivalent.eloquent.saved event).title^3 for boosted relevance).php artisan massive:search:reindex).LIKE queries with bundle-powered searches.| Component | Laravel Equivalent/Adapter Needed | Notes |
|---|---|---|
| Symfony DI | Illuminate\Container + custom bindings |
Use bind() to register bundle services. |
| EventDispatcher | Illuminate\Events\Dispatcher |
Wire up listeners via Event::listen(). |
| Doctrine Metadata | beberlei/doctrineextensions or custom reflection |
Annotate models or use Laravel’s getAttributes() for dynamic mapping. |
| Console Commands | Artisan commands or custom CLI | Extend Illuminate\Console\Command. |
| Expression Language | Native PHP or custom parser | Leverage bundle’s DSL for dynamic queries. |
elastic/elasticsearch, beberlei/doctrineextensions (optional).config/massive_search.php.config/app.php (or use Laravel’s package auto-discovery).Index trait) and run initial reindex.search.query = 'title:php AND price > 100').reindex commands).SearchEvent to log queries for troubleshooting._validate/query API for query validation.How can I help you explore Laravel packages today?