Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

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

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

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

Your Answer

 
discard

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.