pmatseykanets / laravel-scout-postgres

PostgreSQL Full Text Search Engine for Laravel Scout
MIT License
160 stars 38 forks source link

How to sort or order by the search results with specific columns? #16

Closed tortuetorche closed 6 years ago

tortuetorche commented 6 years ago

Apparently laravel-scout-elastic package can do it, but I'm not sure if this postgres engine can do it without some refactoring...

pmatseykanets commented 6 years ago

Thanks for bringing my attention to this.

Just pushed a commit that should resolve it.

You can use orderBy() on a builder instance to define a custom order. If a custom order is not defined then the default one (rank DESC, id ASC) is used.