Laravel 4 laravel algolia只发送特定字段
有没有一种方法可以使用laravel并更新索引—不是所有字段,而是只更新我需要的字段?您可以在模型中使用,并从中返回包含要索引的属性的数组 例如:Laravel 4 laravel algolia只发送特定字段,laravel-4,algolia,Laravel 4,Algolia,有没有一种方法可以使用laravel并更新索引—不是所有字段,而是只更新我需要的字段?您可以在模型中使用,并从中返回包含要索引的属性的数组 例如: use Illuminate\Database\Eloquent\Model; class Contact extends Model { use AlgoliaEloquentTrait; public function getAlgoliaRecord() { return [
use Illuminate\Database\Eloquent\Model;
class Contact extends Model
{
use AlgoliaEloquentTrait;
public function getAlgoliaRecord()
{
return [
'indexedAttribute' => $this->indexedAttribute,
'otherIindexedAttribute' => $this->otherIindexedAttribute,
'nextIndexedAttribute' => $this->nextIndexedAttribute,
];
}
}