diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index e77cb9df..d8e3a6ff 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -111,7 +111,7 @@ public function update($models) * @throws \Typesense\Exceptions\TypesenseClientError * @throws \Http\Client\Exception */ - protected function importDocuments(TypesenseCollection $collectionIndex, array $documents, string $action = 'upsert'): Collection + protected function importDocuments(TypesenseCollection $collectionIndex, array $documents, string $action = 'emplace'): Collection { $importedDocuments = $collectionIndex->getDocuments()->import($documents, ['action' => $action]); diff --git a/tests/Unit/TypesenseEngineTest.php b/tests/Unit/TypesenseEngineTest.php index 8808ffca..f4cfd313 100644 --- a/tests/Unit/TypesenseEngineTest.php +++ b/tests/Unit/TypesenseEngineTest.php @@ -133,7 +133,7 @@ public function test_update_method(): void $documents->expects($this->once()) ->method('import') ->with( - [['id' => 1, 'name' => 'Model 1']], ['action' => 'upsert'], + [['id' => 1, 'name' => 'Model 1']], ['action' => 'emplace'], ) ->willReturn([[ 'success' => true,