On Sun, 18 Dec 2005, Octavian Rasnita wrote:

> Hi,
>
> Please tell me how can I configure MySQL 5 in order to be able to search
> (using fulltext indexes) for combined words like "s-au".
>
> This is a single word and not 2 words but I think MySQL thinks that there
> are 2 words, one of them having a single character, and the second 2 chars,
> so it is not found because I have configured MySQL to index only the words
> that have at least 3 chars.
>
> I don't think it would be a good idea to configure it to index one-char
> words, so I hope there is another method.
>
> Thank you.
>
> Teddy

Hi Teddy,

you may try the following hack to make '-' a normal text character (these
code fragments are from mysql-4.0.25 but it may work with 5.0.x as well):

Change the source in myisam/ftdefs.h

#define true_word_char(X)       (isalnum(X) || (X)=='_')

to

#define true_word_char(X)       (isalnum(X) || (X)=='_' || (X)=='-')

and substitute another char for '-' in myisam/ft_static.c:

const char *ft_boolean_syntax="+ -><()~*:\"\"&|";

which could become something like

const char *ft_boolean_syntax="+ =><()~*:\"\"&|";

Then recompile and try your luck. You have to rebuild your indexes.

Thomas Spahni


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to