Skip to content

Latest commit

 

History

History
executable file
·
13 lines (9 loc) · 649 Bytes

pagination.md

File metadata and controls

executable file
·
13 lines (9 loc) · 649 Bytes

Pagination and search result size

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

By default, Elasticsearch returns only the first 10 search results as you can see in their documentation. Laravel Scout has a take() method and ElasticVision 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();