- Is Bouncy compatible with Laravel 9 or 10?
- No, Bouncy is designed for Laravel 5.x and requires explicit use of the `l5` branch. Modern Laravel versions (9/10) will likely need a maintained fork or alternative like Laravel Scout. Always test compatibility in a staging environment before adoption.
- How do I install Bouncy in Laravel 5?
- Add `fadion/bouncy: ~1.0` to your `composer.json`, run `composer update`, then register the `BouncyServiceProvider` in `app/config/app.php`. Publish the config with `php artisan config:publish fadion/bouncy` and configure Elasticsearch settings.
- Can Bouncy automatically index models on create/update/delete?
- Yes, Bouncy supports automatic indexing via Laravel’s model events. Add the `BouncyTrait` to your Eloquent model, and it will handle indexing lifecycle events (create, update, delete) unless manually disabled in the config.
- What Elasticsearch version does Bouncy support?
- Bouncy is built for Elasticsearch 1.x–2.x APIs. Modern Elasticsearch (7.x+) may require a compatibility layer or client abstraction. Check the `l5` branch’s dependencies for exact version constraints.
- Does Bouncy support pagination and highlights?
- Yes, Bouncy provides built-in pagination for Elasticsearch results and supports highlights for snippets. Configure these in the model’s `search()` method or via the published config file.
- How do I customize field mappings for Elasticsearch?
- Define mappings in your model’s `getBouncyMappings()` method or override the `getBouncyIndex()` method. The package allows full control over index names, types, and field configurations.
- What are the risks of using Bouncy in production?
- Bouncy’s last release was in 2015, so risks include Laravel 5.x deprecations, Elasticsearch API drift, and lack of PHP 8.x support. Test thoroughly in staging, especially if using modern Elasticsearch versions or Laravel features.
- Is there a modern alternative to Bouncy for Laravel?
- Yes, consider Laravel Scout (official) for Algolia/Meilisearch or Elasticsearch, or packages like `spatie/laravel-elasticsearch` for direct Elasticsearch integration. Scout is actively maintained and supports Laravel 9/10.
- How do I manually trigger indexing for a model?
- Call `$model->index()` to manually trigger indexing. This bypasses automatic events and is useful for bulk operations or one-off updates. Combine with `reindex()` for full index rebuilds.
- Can Bouncy handle multi-tenancy or large datasets?
- Bouncy lacks explicit multi-tenancy support, and its age means untested edge cases for large-scale indexing. For production use, consider a fork or alternative with async indexing (e.g., Laravel Scout with Elasticsearch).