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],