Skip to content

Latest commit

 

History

History
executable file
·
12 lines (9 loc) · 361 Bytes

sorting.md

File metadata and controls

executable file
·
12 lines (9 loc) · 361 Bytes

Sorting

By default, your search results will be sorted by their score according to Elasticsearch. If you want to step in and influence the sorting you may do so using the default orderBy() function from Laravel Scout.

use App\Models\Post;

$results = Post::search('Self-steering')
    ->orderBy('published_at', 'desc')
    ->get();