Tuesday, June 25, 2013

Mysql FULTEXT Search

FULTEXT Search

LIKE search

SELECT * FROM articles WHERE body LIKE '%$keyword%';

This was slow and inefficient.Every time someone searched for an article, they got
far too many results.

Fultext search

SELECT * FROM articles WHERE MATCH(title, body) AGAINST ('PHP')

No comments:

Post a Comment