Skip to content

v0.26.0 🐘

Compare
Choose a tag to compare
@meili-bot meili-bot released this 28 Nov 15:04
· 519 commits to refs/heads/main since this release
ecbe0f6

This version makes this package compatible with Meilisearch v0.30.0 πŸŽ‰
Check out the changelog of Meilisearch v0.30.0 for more information on the changes.

πŸš€ Enhancements

Add support to finite pagination (#418) @brunoocasali

Now you can call:

  • $client.search('batman', [ 'page' => 1, 'hitsPerPage' => 10 ])
  • $client.search('batman', [ 'hitsPerPage' => 10 ])
  • $client.search('batman', [ 'page' => 4 ])

results = $client.search('batman', [ 'page' => 4 ])

And get a limited pagination with a fixed number of total hits in the results object results['totalHits'].

You can still use the offset/limit by calling $client.search('batman', [ 'limit' => 4, 'offset' => 10 ])
SearchResult#hitsCount can still retrieve the total hits value.

Add cancelTasks method (#420) @brunoocasali
Allow users to cancel a processing or an enqueued task by using `cancelTasks(CancelTasksQuery $query)`
// CancelTasksQuery methods:
setNext(int $next)
setTypes(array $types)
setStatuses(array $statuses)
setIndexUids(array $indexUids)
setUids(array $uids)
setCanceledBy(array $canceledBy)
setBeforeEnqueuedAt(\DateTime $date)
setAfterEnqueuedAt(\DateTime $date)
setBeforeStartedAt(\DateTime $date)
setAfterStartedAt(\DateTime $date)
setBeforeFinishedAt(\DateTime $date)
setAfterFinishedAt(\DateTime $date)
Add swapIndexes method (#422) @brunoocasali
Add a new method in the Client client->swapIndexes(array $indexes) to swap indexes. The array should follow this structure: [['indexA', 'indexB'], ['indexC', 'indexD'], ...]
Add deleteTasks method (#423) @brunoocasali
Allow users to delete processed, failed, and canceled tasks.

A new method deleteTasks(DeleteTasksQuery $query)

// DeleteTasksQuery methods:
setNext(int $next)
setTypes(array $types)
setStatuses(array $statuses)
setIndexUids(array $indexUids)
setUids(array $uids)
setCanceledBy(array $canceledBy)
setBeforeEnqueuedAt(\DateTime $date)
setAfterEnqueuedAt(\DateTime $date)
setBeforeStartedAt(\DateTime $date)
setAfterStartedAt(\DateTime $date)
setBeforeFinishedAt(\DateTime $date)
setAfterFinishedAt(\DateTime $date)

⚠️ Breaking Changes

  • Add and Update filters to the tasks resource. (#419) @brunoocasali
    • Added setUids(array<int>) filter to match by Task.uid.
    • Added setCanceledBy(array<int>) filter to match by Task.canceledBy
    • Added setBeforeEnqueuedAt(\DateTime) filter to match by Task.beforeEnqueuedAt
    • Added setAfterEnqueuedAt(\DateTime) filter to match by Task.AfterEnqueuedAt
    • Added setBeforeStartedAt(\DateTime) filter to match by Task.beforeStartedAt
    • Added setAfterStartedAt(\DateTime) filter to match by Task.AfterStartedAt
    • Added setBeforeFinishedAt(\DateTime) filter to match by Task.beforeFinishedAt
    • Added setAfterFinishedAt(\DateTime) filter to match by Task.AfterFinishedAt
    • ⚠️⚠️ Renamed setUid(array) to setIndexUids(array) filter to match by Task.indexUid
    • ⚠️⚠️ Renamed setStatus(array) to setStatuses(array<string>) filter to match by Task.status

Thanks again to @brunoocasali ! πŸŽ‰