v0.16.0 🐘
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 ofSearchResult
ex:$index->search('prince')->getHits()
Please check the README and the Wiki to know how to use it!
💡 If you still want to get anArray
as a return, userawSearch()
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 anIndex
object in your code base. Useindex()
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 theprimaryKey
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 anArray
. -
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 anIndex
instance (#124) @curquiza
Thanks again to @Guikingone, @ppshobi, @bidoubiwa and @curquiza ! 🎉