Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 626 Bytes

pagination.md

File metadata and controls

13 lines (9 loc) · 626 Bytes

Pagination and search result size

You can use Laravel Scout's pagination feature to get paginated results from Explorer.

By default, Elasticsearch returns only the first 10 search results as you can see in their documentation. Laravel Scout has a take() method and Explorer uses that to set a custom search result size for Elasticsearch. For example to get a maximum of 300 search results:

use App\Models\Post;

$results = Post::search('Spartans')->take(300)->get();