Skip to content

Instantly share code, notes, and snippets.

@johnlettman-old
Created August 7, 2011 19:46
Show Gist options
  • Save johnlettman-old/1130704 to your computer and use it in GitHub Desktop.
Save johnlettman-old/1130704 to your computer and use it in GitHub Desktop.
SQL Search Template
SELECT MATCH(Content, Title) AGAINST ('%[[KEY1]]% %[[KEY2]]%') as SearchRelevance FROM [[TABLE]] WHERE MATCH(Content, Title) AGAINST('+[[KEY1]]+[[KEY2]]' IN BOOLEAN MODE) HAVING SearchRelevance > 0.1 ORDER BY SearchRelevance DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment