From 6aa615bb7bcc7616604272f5637e822f06759485 Mon Sep 17 00:00:00 2001 From: Alec Ritson Date: Tue, 22 Oct 2024 11:41:00 +0100 Subject: [PATCH] Update TypesenseEngine.php --- src/Engines/TypesenseEngine.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index 5df7c3b..9188e62 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -124,6 +124,8 @@ public function get(): SearchResults } } + $newPaginator = clone $paginator; + $data = [ 'query' => $this->query, 'total_pages' => $paginator->lastPage(), @@ -132,7 +134,7 @@ public function get(): SearchResults 'per_page' => $paginator->perPage(), 'hits' => $documents, 'facets' => $facets, - 'links' => $paginator->setCollection( + 'links' => $newPaginator->setCollection( collect($results['hits']) )->appends([ 'facets' => http_build_query($this->facets),