Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order by relevance #267

Open
cloudeweb opened this issue Jul 30, 2021 · 1 comment
Open

Order by relevance #267

cloudeweb opened this issue Jul 30, 2021 · 1 comment

Comments

@cloudeweb
Copy link

cloudeweb commented Jul 30, 2021

Hello, I have for example this articles:

  1. xbox system update beta
  2. nintendo system update beta
  3. ps4 system update games
  4. ps5 system best games

if search for example: 'system best games' or 'best games system'

Is possible to order by relevance like this?

  1. ps5 system best games
  2. ps4 system update games
  3. xbox system update beta
  4. nintendo system update beta

this is my eloquent query:

$search = $request->input('s');
return Post::search(''.$search.'', ['name' => 10])
                   ->paginate(10);

thanks so much!

@svkmedia
Copy link

@cloudeweb
->orderBy('relevance', 'desc')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants