- How do I install the RediSearch adapter for SEAL in Laravel?
- Run `composer require cmsig/seal cmsig/seal-redisearch-adapter` to install the package. Ensure your Redis server has the RediSearch and RedisJSON modules loaded, and your PHP environment has the `ext-redis` and `ext-json` extensions enabled.
- What Laravel versions are supported by cmsig/seal-redisearch-adapter?
- The package is designed for Laravel 8.x and 9.x, but check the [SEAL documentation](https://github.com/PHP-CMSIG/search) for specific version compatibility. Since it’s under heavy development, verify compatibility with your Laravel version before integrating.
- Can I use DSN (Data Source Name) for Redis configuration instead of hardcoding host/port?
- Yes, the adapter supports DSN configuration. Use formats like `redis://user:pass@host:port` or `redis://host:port&tls=true` in your `.env` file or Laravel Redis configuration. This is useful for environment-specific setups.
- Does this adapter support geo-spatial queries like GeoBoundingBox?
- No, the current version lacks GeoBoundingBox support. Track progress on [this issue](https://github.com/PHP-CMSIG/search/issues/422) for updates. For now, consider alternative solutions like Elasticsearch or Algolia for geo-based queries.
- How do I configure the adapter to work with Laravel Scout?
- This adapter is not a direct replacement for Scout but can integrate with it. Use SEAL’s engine as a custom search driver in Scout’s `engine` config. Example: `'driver' => 'seal', 'engine' => new Engine(new RediSearchAdapter($redis), $schema).`
- What happens if Redis or the RediSearch module crashes during production?
- Implement a fallback mechanism using Laravel’s config-based switch or feature flags. Redirect to a secondary search backend (e.g., database full-text search) if the adapter fails. Monitor Redis health with `redis-cli` and log failures for debugging.
- How can I optimize RediSearch queries for performance in Laravel?
- Leverage RediSearch’s query syntax for complex filters (e.g., `@price:[10 100]`). Cache frequent queries in Laravel’s cache or Redis itself using `FT.AGGREGATE`. Batch index operations with Laravel queues and monitor memory usage with `INFO memory` in Redis.
- Are there any known limitations with text highlighting in search results?
- Yes, the adapter currently lacks HIGHLIGHT support. Track updates on [this issue](https://github.com/PHP-CMSIG/search/issues/491). For now, manually highlight results in your application logic or use a different search backend that supports highlighting.
- How do I handle schema changes in RediSearch indices when using Laravel migrations?
- Use Laravel migrations or SEAL’s schema tools to evolve indices. Document changes in `CHANGELOG.md` and consider wrapping RediSearch commands (e.g., `FT.CREATE`) in Laravel commands or service providers for consistency.
- What alternatives exist if I need GeoBoundingBox or HIGHLIGHT features?
- Consider Elasticsearch (via `elasticsearch/elasticsearch` package) or Algolia for advanced features like GeoBoundingBox and highlighting. For lightweight needs, Laravel’s built-in full-text search or a custom solution with RedisJSON may suffice.