- How do I install the Typesense adapter for Laravel using cmsig/seal?
- Run `composer require cmsig/seal cmsig/seal-typesense-adapter` to install both the search abstraction layer and the Typesense adapter. The package requires Laravel 8+ and PHP 8.0+.
- Can I use this adapter with Laravel Scout for Eloquent model search?
- No, this adapter is designed for cmsig/seal and doesn’t directly integrate with Laravel Scout. However, you can use it as an alternative search backend for Eloquent queries via the SEAL abstraction layer.
- What Laravel versions does the Typesense adapter support?
- The adapter is officially tested with Laravel 8+ and PHP 8.0+. Older versions may require adjustments due to dependency changes in the cmsig/seal project.
- How do I configure the adapter using a DSN in Laravel’s .env file?
- Add `typesense://API_KEY@HOST:PORT?tls=true` to your `.env` file. The adapter automatically parses this DSN for connection details, including TLS support for secure connections.
- Does this adapter support bulk document indexing or updates?
- The adapter leverages Typesense’s native bulk operations, but edge cases like retries or large-scale bulk updates may need manual handling. Refer to the Typesense client documentation for advanced use cases.
- Is there a way to cache search results in Laravel’s cache system?
- The adapter itself doesn’t include built-in caching, but you can wrap SEAL queries with Laravel’s cache system (e.g., `Cache::remember`) to store results temporarily.
- What if I need geospatial search or custom analyzers in Typesense?
- The adapter supports Typesense’s core features but may lack advanced functionalities like geospatial queries or custom analyzers out of the box. You’ll need to extend the schema or adapter directly for these use cases.
- How do I handle schema management in Laravel migrations?
- Define your Typesense schema in a variable (e.g., `$schema`) and pass it to the `Engine` constructor. Use Laravel migrations or seeders to initialize or update the schema on your Typesense server.
- Are there performance benchmarks or optimizations for Laravel?
- The package is under active development, so performance benchmarks aren’t yet published. Optimize by tuning Typesense parameters (e.g., `num_typos`, `query_by`) and leveraging Laravel’s caching for frequent queries.
- What alternatives exist if this adapter isn’t stable enough?
- Consider using the official Typesense PHP client directly or Laravel Scout with Typesense drivers like `spatie/laravel-typesense-scout`. These options offer more mature integrations but may lack SEAL’s abstraction benefits.