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"> -