diff --git a/src/Engine/AlgoliaEngine.php b/src/Engine/AlgoliaEngine.php index 7532bf46..cb0e8dea 100644 --- a/src/Engine/AlgoliaEngine.php +++ b/src/Engine/AlgoliaEngine.php @@ -88,7 +88,8 @@ protected function doUpdate($searchableEntities) $data = []; foreach ($searchableEntities as $entity) { - if (empty($entity->getSearchableArray())) { + $searchableArray = $entity->getSearchableArray(); + if (empty($searchableArray)) { continue; } @@ -98,7 +99,7 @@ protected function doUpdate($searchableEntities) $data[$indexName] = []; } - $data[$indexName][] = $entity->getSearchableArray() + [ + $data[$indexName][] = $searchableArray + [ 'objectID' => $entity->getId() ]; }