Created
January 8, 2018 04:01
-
-
Save tisuchi/95e87dfb5d09e0b431e057648e6b843e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sentence = 'This is my search keyword'; | |
DB::select(DB::raw("SELECT *, MATCH(body) AGAINST('$sentence') as score | |
FROM articles | |
WHERE MATCH(body) AGAINST('$sentence') AND | |
WHERE score > 1 | |
order by score desc | |
LIMIT 3;")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment