How to use mysql LIKE to create a search system?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Don’t. It will be hard to avoid false positives, and it will run hundreds or thousands of times slower than using a real fulltext search solution.
Suppose you search for the word “one”:
This will also match text where words such as “money” “lonely” “bone” etc.
And it has to scan the whole table to compare the pattern to the text in every row. There’s no way a conventional index can help.
Instead, use a FULLTEXT index, or a search engine like Solr or Sphinx Search, or external search engine like Google Custom Search Engine or Yahoo Search Web Services.
See also my presentation Practical Fulltext Search in MySQL.