ruflin/elastica
Elastica is a PHP client for Elasticsearch, providing a rich, object-oriented API for indexing, searching, and managing indices. Compatible with Elasticsearch 9.x+ (branch-specific support for older versions) and integrates with elasticsearch-php.
Architecture fit: The package maintains its clean object-oriented design aligned with Laravel's service container and DI patterns. However, the 9.0.0 release introduces significant BC breaks requiring architectural adjustments: IndexTemplate now exclusively uses the new _index_template API (with Template class for legacy support), and critical method signatures (e.g., SearchableInterface::search) have been simplified. The removal of Elastica\Request class necessitates reconfiguration of client connections.
Integration feasibility: Feasible but requires PHP 8.1+ (dropped support for <8.1) and Laravel 9+ compatibility. Integration requires refactoring existing Elasticsearch interactions, especially for index templates and query methods. Elasticsearch server version compatibility (ES 9 support added) must be verified.
Technical risk: High for legacy systems. Projects using PHP <8.1, Elastica\Request, or the deprecated third argument in search/count methods will face critical failures. Index template migrations require careful handling of legacy vs. new APIs. The BoolQuery fix resolves a subtle data mutation bug but introduces behavioral changes in query serialization.
Key questions:
Elastica\Request or the removed $method argument in search/count calls?Stack fit: Requires Laravel 9+ (PHP 8.1+ dependency) and Elasticsearch 8.x/9.x. Verify compatibility of all transitive dependencies (e.g., Guzzle, Symfony components) with PHP 8.1+. The package now supports ES 9 features like Component Templates, but legacy ES 7.x clusters may require explicit Template class usage.
Migration path:
Elastica\IndexTemplate with Elastica\Template for legacy API usage or Elastica\IndexTemplate for new _index_template API.search()/How can I help you explore Laravel packages today?