From acc80d1ef8ee9f262c3014f82e0fbac9c06e6049 Mon Sep 17 00:00:00 2001 From: Pawel Detka Date: Mon, 20 Feb 2023 15:13:56 +0100 Subject: [PATCH] Minor fixes after refactor --- Adapter/Client.php | 2 +- Services/ConfigService.php | 2 +- etc/di.xml | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Adapter/Client.php b/Adapter/Client.php index f59f375..9d66e35 100644 --- a/Adapter/Client.php +++ b/Adapter/Client.php @@ -54,7 +54,7 @@ public function deleteIndex(string $indexName): array */ public function addData($indexName, $data) { - return $this->typeSenseClient->collections[$indexName]->documents->create_many($data, ['action' => 'upsert']); + return $this->getTypesenseClient()->collections[$indexName]->getDocuments()->import($data, ['action' => 'upsert']); } /** diff --git a/Services/ConfigService.php b/Services/ConfigService.php index fc930e6..cf8bbe9 100644 --- a/Services/ConfigService.php +++ b/Services/ConfigService.php @@ -44,7 +44,7 @@ public function __construct( */ public function isEnabled(): ?int { - return $this->scopeConfig->getValue(self::TYPESENSE_ENABLED, ScopeConfig::SCOPE_STORE); + return (int) $this->scopeConfig->getValue(self::TYPESENSE_ENABLED, ScopeConfig::SCOPE_STORE); } /** diff --git a/etc/di.xml b/etc/di.xml index 61681f6..12efa73 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -3,6 +3,5 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> -