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

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:
http://www.mysql.com/doc/en/Fulltext_Search.html

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)
> AGAINST ('
and 

> 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,
TK


__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003
Thread
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