diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index 9048ac7..8f43527 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -134,16 +134,14 @@ protected function buildSearch(array $options): array $requests = []; $facets = $this->getFacetConfig(); - - $filters = collect($options['filter_by']); - - foreach ($this->filters as $key => $value) { - $filters->push($key.':'.collect($value)->join(',')); - } - + foreach ($searchQueries as $searchQuery) { - $filters = collect(); + $filters = collect($options['filter_by']); + + foreach ($this->filters as $key => $value) { + $filters->push($key.':'.collect($value)->join(',')); + } $facetQuery = collect();