Lets say I'm searching the field title
, how would I set it up so you could use + and - on keywords on an SQL level?
views:
25answers:
1
+3
A:
Welcome to the world of Full-text searches, especially boolean searches.
Slightly modified example from the manual:
SELECT * FROM articles WHERE MATCH (title)
AGAINST ('+MySQL -YourSQL' IN BOOLEAN MODE);
you don't even need to create a FULLTEXT
index for these kinds of searches but it is very recommended.
Pekka
2010-05-11 21:07:13
sweet, thanks :)
Webnet
2010-05-12 13:15:51