我在Algolia发送一个数组需要索引时遇到了一些困难,因为我必须先编码它才能将其保存到数据库中。通过Algolia的Laravel搜索框架发送数组索引
$algoliaAgent = AlgoliaAgent::firstOrCreate([
'FirstName' => $item->FirstName,
'LastName' => $item->LastName,
'AgentRecId' => $item->AgentRecId,
'Style' => json_encode(explode(',', $item->Style))
]);
$algoliaAgent->pushToIndex();
在Algolia结果索引是这样的:
"[\"value1\",\"value2\",\"value3\"]"
是否有其发送到Algolia之前将值解码的方法?
使用Laravel 5.2 –