Skip to content

Instantly share code, notes, and snippets.

@razzul
Created January 11, 2017 11:19
Show Gist options
  • Save razzul/b6a5ae95562fc7445970b404d34bc99f to your computer and use it in GitHub Desktop.
Save razzul/b6a5ae95562fc7445970b404d34bc99f to your computer and use it in GitHub Desktop.
MySQL : Full text search

Col : comment
Searching string : 294
Exclude : 100

SELECT * FROM 
    `tbl_business_review` 
WHERE 
    MATCH(comment) 
    AGAINST('+294 -100' IN BOOLEAN MODE)

N.B. Full-text indexes can be used only with MyISAM tables. (In MySQL 5.6 and up, they can also be used with InnoDB tables.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment