How can I achieve this specific ordering on id with MeiliSearch in Laravel Scout?
$ids = [152,153];
$showcasePosts = ShowcasePost::search('')
->whereIn('tags.name', $tags)
->orderBy('tags.confidence', 'desc')
->paginate($this->perPage);
I want that specific $ids at last. like this [1,2,3,4,...200,201,152,153]
I have one solution in database query that I can achieve but not with meilisearch because OrderByRaw is not supported in meilisearch.
->orderByRaw(DB::raw('
CASE
WHEN id IN ('.implode(',', $ids).') THEN 1
ELSE 0
END ASC,
tags.confidence DESC,
updated_at DESC
'))
Is there any other solution then please help me.
Thanks in advance.