In order to fine tune your Meilisearch implementation with Laravel Scout, it’s a good idea to set up some filters on your index. With Eloquent queries, filtering results is easy. Out of the box, you just add a ->where('x', 'y')
or other condition to return results with. You can do the same with Meilisearch, but it has to be configured first.
Since Meilisearch is not a relational database, these have to be very simple filters. However, when using Meilisearch, I’ve never run into a situation where this became an issue. We are usually letting the full text query do the filtering for us. I usually apply these filters in situations where we need “only results for a user” or “number is greater than x” along with a full text search. Let’s get started!