X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/62342433f41f2eaef19c5e85f5ce960297ee8206..refs/pull/802/head:/app/Http/Controllers/SearchController.php diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 0827eeb71..ddc92f705 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -40,13 +40,12 @@ class SearchController extends Controller $nextPageLink = baseUrl('/search?term=' . urlencode($searchTerm) . '&page=' . ($page+1)); $results = $this->searchService->searchEntities($searchTerm, 'all', $page, 20); - $hasNextPage = $this->searchService->searchEntities($searchTerm, 'all', $page+1, 20)['count'] > 0; return view('search/all', [ 'entities' => $results['results'], 'totalResults' => $results['total'], 'searchTerm' => $searchTerm, - 'hasNextPage' => $hasNextPage, + 'hasNextPage' => $results['has_more'], 'nextPageLink' => $nextPageLink ]); }