I have read that using fulltext searching is faster then using LIKE %%. I have updated my script but it always seems to always have 0 results.
SELECT *,
MATCH(pages) AGAINST('doodle') AS score
FROM books
WHERE MATCH(pages) AGAINST('doodle')
ORDER BY score DESC
The $keyword is longer then 4 chars and I have index the pages column as fulltext. I have “doodle” in the pages column in this format “yankee doodle”.
I have also tried this
SELECT *,
MATCH(pages) AGAINST ('doodle' IN BOOLEAN MODE) AS score
FROM books
WHERE MATCH(pages) AGAINST ('doodle' IN BOOLEAN MODE)";
Neither of them works :\
Fulltext search has some bizarre quirks.
For example, the behaviour described in the last paragraphs of this page could be the reason for your problem:
The answer here would be to add more rows, or use boolean search.
If you need weighted search results, check out the comment
Posted by John Craig on December 16 2009 7:01pmon the linked page for a workaround suggestion.