Not valid code example in documentation
ivan-dovhai opened this issue · comments
client->multiSearch([ (new SearchQuery()) ->setIndexUid('movies') ->setQuery('pooh') ->setLimit(5), (new SearchQuery()) ->setIndexUid('movies') ->setQuery('nemo') ->setLimit(5), (new SearchQuery()) ->setIndexUid('movie_ratings') ->setQuery('us') ]);
What is "client"? This is not variable, not new class instance. This is not valid php code example.
Hello @ivan-dovhai
In the API reference Overview, you can see how to authenticate, so how to set up the client
: https://www.meilisearch.com/docs/reference/api/overview#authorization
This set client
will be used in all the following examples, to avoid too much repetition.
You can also find more information in the PHP README
Thanks for reporting this, @ivan-dovhai.
As @curquiza mentioned, for instructions on how to set up $client
, please consult the PHP readme or the API overview.
However, that code sample is indeed missing a $
, since in the majority of cases $client
is going to be a variable storing an instance of the Client
class. @curquiza, I have submitted a PR fixing that on the meilisearch-php
repo: meilisearch/meilisearch-php#633