I try to migrate a SQL based search to meilisearch using laravel scout.
At the moment the whole search should be migrated to meilisearch, including all filter and sorting options.
A product
has a relation to feedbacks
(product model):
//returns all feedbacks for the product
public function allFeedbacks()
{
return $this->hasMany('App\Models\Feedback');
}
I would like to include the amount of feedbacks to meilisearch, but not the whole relation, since it's not required for sorting.
How can I add additional fields to be index by meilisearch, without including a field into the mySQL database (feedback_amount
f.e.)?