From b18000971f3a51c5f29d7383405e66c5f0d641c6 Mon Sep 17 00:00:00 2001 From: Alec Ritson Date: Mon, 21 Oct 2024 12:09:11 +0100 Subject: [PATCH] Update TypesenseEngine.php --- src/Engines/TypesenseEngine.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index 898c567..406bddd 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -71,10 +71,7 @@ protected function buildSearchOptions(array $options, string $query, $useFacetFi $options['filter_by'] = $filters->join(' && '); } - return [ - 'collection' => 'voltimum_products', - ...$options - ]; + return $options; } public function get(): SearchResults @@ -90,7 +87,9 @@ public function get(): SearchResults ] ]; - $response = $engine->getMultiSearch()->perform($searchRequests); + $response = $engine->getMultiSearch()->perform($searchRequests, [ + 'collection' => (new $this->modelType)->searchableAs(), + ]); return [ ...$response['results'][0],