Warning
This is a beta release.
Migration guide
Database stats now return a typed Stats object
$stats = $client->stats();
// Before (v1.x) - accessing stats as array
$databaseSize = $response['databaseSize'];
$usedDatabaseSize = $response['usedDatabaseSize'];
// etc...
// After (v2.x) - use getter methods
$databaseSize = $stats->getDatabaseSize();
$usedDatabaseSize = $stats->getUsedDatabaseSize();Version is now a typed Version object
$version = $client->version();
// Before (v1.x) - access as array
$commitSha = $version['commitSha'];
$commitDate = $version['commitDate']; // String
$pkgVersion = $version['pkgVersion'];
// After (v2.x) - use getter methods
$commitSha = $version->getCommitSha();
$commitDate = $version->getCommitDate(); // \DateTimeImmutable
$pkgVersion = $version->getPkgVersion();Removed legacy MeiliSearch namespace
We removed MeiliSearch (capital S) namespace.
// Before (v1.x) - MeiliSearch with capital S
use MeiliSearch\Client;
// After (v2.x) - Meilisearch without capital S
use Meilisearch\Client;Removed Indexes::parseDate() public method
This only affects you if you were using this utility method directly.
// Before (v1.x) - If you used this method in your code
$dateTime = \Meilisearch\Endpoints\Indexes::parseDate('2021-01-01T01:23:45.123456Z');
// After (v2.x) - Use native PHP instead
$dateTime = new \DateTimeImmutable('2021-01-01T01:23:45.123456Z');⚠️ Breaking changes
- Remove custom date parsing (#826) @norkunas
- Add typed
Statsobject (#823) @norkunas - Remove remaining custom datetime parsing (#827) @norkunas
- Add typed
Versionobject (#821) @norkunas - Remove legacy namespace (#822) @norkunas
🐛 Bug Fixes
- Fix: expose facetStats in SearchResult::toArray (#828) @walkwizus
⚙️ Maintenance/misc
- Add PHP 8.5 to CI (#829) @norkunas
- allow symfony/http-client 8.0 (#820) @tacman
- Fix test namespaces (#824) @norkunas
- Add PHP 8.5 to CI (#829) @norkunas
- chore: handle unknown commit date in version (#836) @Strift
- Use Meilisearch Enterprise Edition (#835) @Strift
Thanks to @Strift, @bpolaszek, @dependabot[bot], @norkunas, @tacman, and @walkwizus! 🎉
See full changelog: v2.0.0-beta.1...v2.0.0-beta.2