I can't get scout working properly with algolia.
I added the client relationship to the searchable array:
public function toSearchableArray()
{
$this->client;
$array = $this->toArray();
$array = $this->transform($array);
return $array;
}
And want to search for these attributes:
'searchableAttributes' => ['title', 'description', 'client.naam', 'client.email'],
when i do:
Project::search($keyword)->where('user_id', $request->user_id)->where('finished', true)->orderBy('created_at', 'DESC')->paginate(10);
i don't get any result. Everything is imported en synced correctly al well.
But the records are uploaded to algolia en indexed correctly and when i search in the algolia dashboard i get the correct results. Does anyone know what i'm doing wrong?