Migration guide
If you're migrating from v1.x, read the complete migration guide.
API keys API now uses typed query and result objects
API key methods no longer accept array-based write payloads or return plain list shapes. They now use CreateKeyQuery and UpdateKeyQuery for requests, KeysResults for lists, and KeyAction for actions.
// Before (v1.x)
$key = $client->createKey([
'description' => 'tenant token key',
'actions' => ['*'],
'indexes' => ['tenant*'],
'expiresAt' => '2055-10-02T00:00:00Z',
]);
// After (v2.x)
$key = $client->createKey(new CreateKeyQuery(
actions: [KeyAction::Any],
indexes: ['tenant*'],
description: 'tenant token key',
expiresAt: new DateTimeImmutable('2055-10-02T00:00:00Z'),
));The client updateKey method accepts an UpdateKeyQuery, which works similarly. It allows clearing the key name or description by passing null.
Additionally, KeysResults::count() was removed; use count($keysResults) instead.
Type improvements
SimilarDocumentsQuery,FacetSearchResult, andSearchResultare now final
๐งช Experimental features
- Update network API compatibility to Meilisearch v1.37 (#888) @Strift
- Add dynamic search rules API API (#910) @Strift
โ ๏ธ Breaking changes
These other changes only pertain to PHPStan type hints improvements:
- Add type hints to
DocumentsResults(#908) @norkunas - Add type hints to, and make query and results classes final (#909) @norkunas
- Add types to
Data'sArrayAccessmethods (#912) @norkunas
๐ Enhancements
- Add support for
showPerformanceDetailsoption (#871) @QDenka - Add index compaction API (#874) @norkunas
- Add support for
distinctin federated search requests (#892) @mvanhorn - Add dynamic search rules (#910) @Strift
๐ Bug Fixes
- Use
array_key_existsinstead ofissetinTask::offsetExists(#870) @norkunas - Fix uninitialized properties in TasksQueryTrait (#875) @norkunas
โ๏ธ Maintenance/misc
- Fix non-working link (#876) @norkunas
- chore: update tests for v1.36.0 (#879) @Strift
- Replace localhost:7700 with MEILISEARCH_URL (#880) @Strift
- Remove unused code samples (#885) @curquiza
- Update release drafter workflow to handle beta releases (#907) @Strift
Thanks to @QDenka, @Strift, @curquiza, @mvanhorn and @norkunas! ๐
See full changelog: v2.0.0-beta.5...v2.0.0-beta.6