Meilisearch is an amazingly powerful full text search engine. In order to take full advantage of the power of Meilisearch and Laravel Scout, you’ll have to get in the nitty gritty. One of those times is when you want to sort search results with once they’ve been returned from Meilisearch.
When making a query through Laravel Eloquent, this is easy. Simply just add an ->orderBy('column_name', 'direction')
to the end of your query. However, with Laravel Scout and Meilisearch, there needs to be a few steps in configuration before you can order your results. Since Meilisearch is such a fine tuned system, everything has to be configured explicitly. Luckily, Laravel provides that power out of the box. We just have to configure everything correctly.