Skip to content

Instantly share code, notes, and snippets.

@ruckus
Created April 24, 2012 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruckus/2483945 to your computer and use it in GitHub Desktop.
Save ruckus/2483945 to your computer and use it in GitHub Desktop.
SELECT contacts.*, ts_rank_cd(contacts.search_content, to_tsquery('purple & drank')) as rank
FROM contacts
WHERE contacts.search_content @@ to_tsquery('purple & drank')
ORDER BY rank DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment