Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?



share|improve this question

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.

share|improve this answer
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#'. – postalservice14 May 17 '10 at 15:07
set ft_min_word_len to 2 :) – Marco Ramos May 17 '10 at 17:17

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.

share|improve this answer

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...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.