Search query
Date: 01/01/06
(MySQL Communtiy) Keywords: no keywords
I am building that joy of modern life, a search page and i seem to have run into a few problems (well, one so far, but im sure there are more on the way)
An example of the query is:
SELECT id, title, description MATCH(title, description, data_text) AGAINST('about' IN BOOLEAN MODE) AS score FROM `content` WHERE `privlevel` <= 0 AND MATCH(title, description, data_text) AGAINST('about' IN BOOLEAN MODE) ORDER BY score DESC, title ASC
and the error i get is:
text search query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'MATCH(title, description, data_text) AGAINST('about' IN BOOLEAN
It is meant to take the search string (in this case, "about") and see if it can find it in the title, description and data_text fields of the content table. It is also meant to do a very basic score too, so with any luck, the best matches pass through to the top...
Can you see the error, or even better, do you know of a neater, fast way of doing this?
Thanks for any help.
Source: http://www.livejournal.com/community/mysql/80181.html