Customizing Setting of Scout MeiliSearch

Written by Neo Likotsi on Jul 15th, 2021 Views Report Post

Laravel 8's scout package added support for a MeiliSearch engine see docs.

The functions exposed by Laravel Scout are good to build the basic search query against your index, but I found that is not straight forward to do a WhereIn query.

Fortunately, scout allows us to customize the query to build a more complex query.

use MeiliSearch\Endpoints\Indexes;

...

$searchable->search($query, function(Indexes $meiliSearch, $query, $options) { ... });

In the callback function is where you can customize the filters in the options object to tell MeiliSearch how to pass a search. You can check the documentation to search for the options available in the query language.

Comments (0)