Skip to content

v0.16.0 🐘

Compare
Choose a tag to compare
@meili-bot meili-bot released this 21 Jan 16:31
e96b639

Sorry for all the breaking changes, our goal is to make this package as good and easy-to-use as possible! If you have any trouble, feel free to open an issue in the repo. We will glad to guide you through all these changes!

Breaking changes ⚠️

  • The search() method has now the following prototype:
    public function search($query, array $searchParams = [], array $options = [])
    The usage is described in the Wiki.
    (#120) @Guikingone

  • The search() method now returns a instance of SearchResult
    ex: $index->search('prince')->getHits()
    Please check the README and the Wiki to know how to use it!
    💡 If you still want to get an Array as a return, use rawSearch() or set the $option parameter to ['raw' => true].
    (#120) @Guikingone

  • $client->getIndex() is still present but does an HTTP call. This method should be only used to fetch information from the MeiliSearch instance, not to manipulate an Index object in your code base. Use index() instead. See the Getting Started to be sure using this SDK the most optimized way. (#124) @curquiza

  • $client->updateIndex returns an Index instance. (#124) @curquiza

  • $index->getPrimaryKey() does not do any HTTP call, but only returns the primaryKey attribute. Use $index->fetchPrimaryKey() if you want the same behavior as the old $index->getPrimaryKey() (#124) @curquiza

  • $index->show() is removed and replaced by $index->fetchInfo() (returns an instance) and $index->fetchRawInfo() (returns an array) (#124) @curquiza

  • $client->showIndex($uid) is removed. Use $client->getIndex($uid) (returns an instance) or $client->index($uid)->fetchRawInfo() (returns an array) instead. (#124) @curquiza

Changes

  • The SearchResult instance contains the new methods described in this section of the Wiki. (#120) @Guikingone and (#134) @curquiza

  • Add the rawSearch() method (#134) @curquiza
    This method has the same behavior as the "old" search() method: it returns the raw response sent by the MeiliSearch in an Array.

  • Introduction of the $client->index($uid) method that replaces $client->getIndex($uid). getIndex() is still available but does HTTP call, so this should be only used to fetch information from the MeiliSearch instance. See our Getting Started to use this package the right way (#124) @curquiza

  • New attribute in the Index class: primaryKey accessible via the getter $index->getPrimaryKey() (#124) @curquiza

  • New method $index->fetchRawInfo(): returns an array of index (#124) @curquiza

  • New method $index->fetchInfo(): returns an Index instance (#124) @curquiza

Thanks again to @Guikingone, @ppshobi, @bidoubiwa and @curquiza ! 🎉