- How does SEAL compare to Laravel Scout for search abstraction in Laravel?
- SEAL is a lower-level abstraction layer like Doctrine DBAL, while Scout is a higher-level model integration tool. SEAL lets you define custom schemas, query DSLs, and supports multiple engines (Elasticsearch, OpenSearch, etc.) independently of Eloquent. Scout can be built *on top* of SEAL via a custom `Engine` adapter, but SEAL offers more flexibility for non-Scout use cases like microservices or complex filtering.
- Which Laravel versions and PHP versions does SEAL support?
- SEAL requires PHP 8.1+ and is designed for Laravel 9+. It follows Laravel’s service container and configuration patterns, so it integrates seamlessly with Laravel’s dependency injection. Always pin to a specific version in `composer.json` to avoid breaking changes, as the project is still evolving.
- Can I use SEAL with Elasticsearch and OpenSearch simultaneously for failover?
- Yes, SEAL supports multi-engine setups. You can configure fallback logic in your `config/search.php` to switch between Elasticsearch and OpenSearch if one fails. The abstraction layer ensures consistent query syntax across engines, though you may need to test performance trade-offs for complex queries.
- How do I install and configure SEAL for a Laravel project?
- Run `composer require cmsig/seal`, then register the service provider in `config/app.php` and define engine-specific credentials in `.env` (e.g., `SEARCH_ENGINE=elasticsearch`, `ELASTICSEARCH_URL`). Configure default settings in `config/search.php`, including schema definitions and query builders. Follow the [official docs](https://php-cmsig.github.io/search/) for step-by-step setup.
- Does SEAL support schema migrations or dynamic field additions?
- SEAL includes schema management tools to define and update index structures. You can add fields, modify mappings, or reindex data via console commands (e.g., `php artisan search:reindex`). However, schema changes may require careful testing across engines, as some (like Elasticsearch) handle dynamic fields differently than others.
- What’s the performance impact of using SEAL vs. raw Elasticsearch PHP client?
- SEAL adds a thin abstraction layer, typically introducing <5ms overhead per query. For most use cases, this is negligible, but benchmark against raw clients (e.g., Elasticsearch’s official PHP client) if you’re running high-throughput searches. Async indexing via Laravel queues can mitigate latency for bulk operations.
- Are there adapters for Meilisearch or Typesense, or should I build one?
- As of now, SEAL prioritizes Elasticsearch and OpenSearch adapters. Meilisearch or Typesense support is experimental or missing. If you need these engines, check the [GitHub discussions](https://github.com/php-cmsig/search/discussions) for community efforts or consider contributing an adapter using SEAL’s `Engine` interface.
- How can I integrate SEAL with Laravel Scout for Eloquent models?
- Create a custom `ScoutEngine` implementation that wraps SEAL’s `SearchEngine` interface. Override methods like `updateIndex`, `search`, and `delete` to bridge SEAL’s query DSL with Scout’s model-based API. This lets you reuse SEAL’s multi-engine capabilities while keeping Scout’s model syncing features.
- What’s the best way to handle async indexing with SEAL in Laravel?
- Use Laravel queues to offload heavy indexing tasks. Dispatch a `SearchIndexJob` (or similar) that uses SEAL’s `IndexManager` to batch-index documents. Combine with Laravel’s `cache()` or `redis()` for temporary storage during processing. Monitor queue jobs with Horizon for production reliability.
- Is SEAL production-ready, or should I wait for more adoption?
- SEAL is functional and suitable for production, but its early-stage status (low GitHub stars, limited dependents) means edge cases may need custom handling. Test thoroughly with your target engines, especially if using unsupported adapters. Monitor the [php-cmsig/search repo](https://github.com/php-cmsig/search) for updates and contribute feedback to shape its roadmap.