Skip to content

CakePHP Elasticsearch 5.0.0

Latest

Choose a tag to compare

@josbeir josbeir released this 03 Nov 15:31
· 18 commits to 5.x since this release

The CakePHP core team is proud to announce the immediate availability of CakePHP Elasticsearch 5.0.0. This is a major release for the 5.x branch that includes breaking changes and new features.

Breaking Changes

  • Elastica 9.x Support: Upgraded from ruflin/elastica 7.x to 9.x, bringing support for Elasticsearch 9.x.
    • As Elastica now uses elasticsearch-php the client configuration using the hosts array format could be used instead of the legacy host/port or uri format (still working).
  • CakePHP 5.2+ Required: Minimum CakePHP version is now 5.2.0.
  • PHP 8.1+ Required: Dropped support for older PHP versions.
  • IndexRegistry Removed: The deprecated IndexRegistry class has been removed in favor of IndexLocator with IndexLocatorAwareTrait.
  • Removed Deprecated Methods: All methods deprecated in 3.x and 4.x have been removed:
    • QueryBuilder::and_() and QueryBuilder::or_() - Use and() and or() instead
    • Embedded::property(), entityClass(), indexClass() - Use getter/setter methods instead
    • Query::repository() - Use setRepository() instead

New Features

  • IndexLocatorAwareTrait: New trait providing access to the IndexLocator with a fetchIndex() method, aligning with the ORM's fetchTable() pattern.
  • InvalidPropertyInterface Support: Documents now support InvalidPropertyInterface for validation error handling.
  • Track Total Hits: Added Query::trackTotalHits() method for control over Elasticsearch's track_total_hits feature.
  • FQDN Class Support: IndexLocator now supports fully-qualified class names for index loading.

Improvements

  • Strict Typing: Improved strict types throughout the codebase.
  • Code Quality: Removed PHPStan baseline, added Rector support, and improved test coverage to +- 90%.
  • PHPUnit 10-12 Support: Updated test suite to support PHPUnit 10.5+, 11.5+, and 12.1+.
  • Marshaller Alignment: Better alignment with CakePHP ORM patterns.
  • Improved Type Hints: Enhanced type hinting across the codebase.

Full Changelog: 4.0.1...5.0.0


As always, a huge thanks to all the community members that helped make this release happen.