Hi,
It seems the limit()
option is not available, if I read the documentation it seems it should be available.
$items = FaqItem::search(request('query'))->limit(5)->get();
Returns me with an error:
exception: "BadMethodCallException"
file: "/Users/***/Workspace/***/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php"
line: 103
message: "Method Laravel\Scout\Builder::limit does not exist."
Is there something I am missing, or is this method missing from the package?
I think the documentation is wrong here. Correct would be the following:
$items = FaqItem::search(request('query'))->take(5)->get();
take()
will work indeed, but does that make actual use of the limit function in the meilisearch API?
https://docs.meilisearch.com/guides/advanced_guides/search_parameters.html#limit
Yeah I have noticed that, then the documentation is indeed not correct I recon.
You have right, my mistake take()
is the correct one !
And to confirm yes the $builder->limit works has expected when using take()
I will update the doc ;)
Thank you!
Keep up the awesome work 🚀
Most helpful comment
You have right, my mistake
take()
is the correct one !And to confirm yes the $builder->limit works has expected when using
take()
I will update the doc ;)
Thank you!