MySQL Forums
Forum List  »  Full-Text Search

Re: problems with searches for 'c#' and 'c++' fulltext
Posted by: Jesse Morrow
Date: March 30, 2007 06:32PM

I think the answer is that it just can't be done yet with MySQL FULLTEXT searching because the + and # characters are not indexed. MySQL only indexes alphanumeric words with the addition of . and ' characters.

Two ways you might address the problem:

1) When you encounter such non-indexable words fall back to searching using basic LIKE 'c++' constructs. You will of course have to create extra indices on these columns to keep things fast.

2) Alternatively, and a lot more involved, you could create a special copy of the FULLTEXT columns that has such character sequences encoded as something that is searchable and then convert the users search string to match.

So, a contrived example would be to replace all 'c++' sequences with 'cpp' or 'c00' in a special column used just for searching. When the user types in 'c++' convert it to your encoded value before searching.

Best Luck,

Jesse Morrow

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: problems with searches for 'c#' and 'c++' fulltext
3786
March 30, 2007 06:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.