List:General Discussion« Previous MessageNext Message »
From:tk Date:December 31 2003 9:27pm
Subject:Re: FULLTEXT Search and Hyphens
View as plain text  

Fulltext section of mysql manual: "MySQL uses a very
simple parser to split text into words. A "word" is
any sequence of characters consisting of letters,
digits, " ' ", and  " _ ". Any "word" that is present
in the stopword list or is just too short is ignored."

Thus a hyphen would be viewed as a non-word character
and kk-4835 would be split in kk and 4835. And since
the default min. word length is 4, kk would not be
index but 4835 would be. For more info:

The only way to search for kk-4835 is to do the search
in Boolean mode and put things in quotes -> So your query would look like this:

> SELECT * FROM ms_items
> where MATCH (it_mnfgID, it_title, it_descrip)

> I want to be able to type in "KK-4835", "KK4835", or
> even "KK 4835)

To be able to search for the variations you described
above I would just parse the search and insert a
hyphen where it is missing and then perform the same
search above.

Hope this helps,

Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
FULLTEXT Search and Hyphensmichael elston31 Dec
  • Re: FULLTEXT Search and HyphensDan Nelson31 Dec
  • Re: FULLTEXT Search and Hyphenstk31 Dec
    • Re: FULLTEXT Search and Hyphenstk31 Dec
  • Re: FULLTEXT Search and HyphensThomas Spahni5 Jan