From acb1bcd49f4e2926b5233f3d5ee5f53fa61ba120 Mon Sep 17 00:00:00 2001 From: hi019 <65871571+hi019@users.noreply.github.com> Date: Fri, 3 Dec 2021 10:30:01 -0500 Subject: [PATCH] Fix document import error --- src/Typesense.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Typesense.php b/src/Typesense.php index 862d64a..ea4740b 100644 --- a/src/Typesense.php +++ b/src/Typesense.php @@ -167,7 +167,7 @@ public function importDocuments(Collection $collectionIndex, $documents, string $result = []; foreach ($importedDocuments as $importedDocument) { - if ($importedDocument["code"] !== 200) { + if (!$importedDocument['success']) { throw new TypesenseClientError("Error importing document: ${importedDocument['error']}"); }