1

It appears MySQL FullText index does not index the word 'C#'. Probably because the character '#' is removed and you are left with C, which is too short to index.

My question is, how would I go about indexing 'C#' so that it is searchable in my FullText index?

Thanks,

John

3 Answers 3

0

I think this can be solved tuning the ft_min_word_len system variable, which is used to set the minimum length of words to be indexed. Set this value to two. More info here.

2
  • Thanks for the reply. However, I don't think setting the minimum length to 1 is a good idea. I don't want to index 'C'. I want to index 'C#'. May 17, 2010 at 15:07
  • set ft_min_word_len to 2 :) May 17, 2010 at 17:17
0

I don't know of a way to do this, and searching around it seems to be accepted as a limitation of fulltext search in MySQL.

I guess you already considered this, but just in case: you can encode non-searchable characters before storing the data in your database. So C# would become C.Sharp, C++ would become C.Plus.Plus, etc.

0

You can upgrade ft_min_word to allow 2 characters, by default this is set to 4 characters, which to most people is a little to much, 3 would be more suitable. I have mine set to 2.

Also amongst the configuration files of MySQL full-text, you can alter a list of ignored words. I have yet been in the myself but you may find # as one of the ignored words/symbols...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .