diff --git a/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php b/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php index 0c9bf6593..c57354ed4 100644 --- a/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php +++ b/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php @@ -100,6 +100,9 @@ public function deleteDocuments(IndexInterface $index, TypeInterface $type, arra */ public function updateDocument(IndexInterface $index, TypeInterface $type, $docId, array $data) { + $this->bulkData[] = ['update' => ['_index' => $index->getName(), '_type' => $type->getName(), '_id' => $docId]]; + $this->bulkData[] = ['doc' => $data]; + return $this; } @@ -108,6 +111,10 @@ public function updateDocument(IndexInterface $index, TypeInterface $type, $docI */ public function updateDocuments(IndexInterface $index, TypeInterface $type, array $data) { + foreach ($data as $docId => $documentData) { + $this->updateDocument($index, $type, $docId, $documentData); + } + return $this; } }