Created
April 30, 2012 18:54
-
-
Save ruckus/2561258 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
SELECT varietals.*, ts_rank_cd(varietals.search_content, plainto_tsquery('vinosmith', 'gruner')) as rank | |
FROM varietals WHERE varietals.search_content @@ plainto_tsquery('vinosmith', 'gruner') | |
ORDER BY rank DESC limit 25 | |
=> [#<Varietal id: 657, name: "Grüner Veltliner" .. ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment