Help - Search - Members - Calendar
Full Version: MySQL full text search and words containing dash
Invision Power Services > Community Forums > Community Web Design and Coding
Sebastian Mares
Hi!

I am wondering if MySQL treats the dash in "add-ons" for example as a "not" operator since the query
SQL
SELECT * FROM mws_search WHERE MATCH (keywords) AGAINST ('add-ons' IN BOOLEAN MODE);
doesn't return any results although the field contains the word "add-on".
If yes, is it possible to tell MySQL to treat the dash as string?

Regards,
Sebastian

Edit: The table is indexed since the same query for "addon" works when the table contains "addon".
Sebastian Mares
Just had a look at MySQL bug #3150 and found out that it is related to the word-length. Since the dash is not a legal word character and "add" has only three characters nothing is returned.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.