List:Internals« Previous MessageNext Message »
From:Andrew Hutchings Date:November 13 2009 9:53am
Subject:Re: quot in MYSQL_FTPARSER_BOOLEAN_INFO
View as plain text  
Hello Sergei,

Thanks for the quick response.

On Fri, 2009-11-13 at 09:22 +0100, Sergei Golubchik wrote:
> > When dealing with quotation marks in a search I tried setting this to
> > "(char*) 1" (I've seen this done in Hiroaki Kawai's examples) and it
> > behaved quite strangely.  Removing all use of quot and it started
> > working (obviously setting yesno = 1).
> 
> I think it wasn't working completely corectly. Perhaps looking for
> 
>   ' "aaa bbb" '
> 
> it was also finding rows with "bbb aaa" ?

Hmm...without quot it does do that, yes.  With quot it was finding
nothing at all, as if the contents of the quote marks were empty (ie.
text outside the quotes were matched as normal to give a result).

I was doing the equivalent of:

boolinfo.quot = (char*) 1;
boolinfo.type = FT_TOKEN_LEFT_PAREN;
mysql_add_word(param, NULL, 0, &boolinfo);

// reset boolinfo

boolinfo.yesno = 1;
boolinfo.quot = (char*) 1;
mysql_add_word(param, doc, length, &boolinfo);

// reset boolinfo
// repeat until all words in quotes are pushed

boolinfo.type = FT_TOKEN_RIGHT_PAREN;
boolinfo.quot = (char*) 1;
mysql_add_word(param, NULL, 0, &boolinfo);

Removing the boolinfo.quot stuff from above makes it work but as you say
"aaa bbb" also matches "bbb aaa".

> > So my question is, what is quot really for (is it redundant?) and how
> > do you use it?
> 
> set it to be not null on any opening quotation mark.

That makes sense.

Kind Regards
-- 
Andrew Hutchings, MySQL Support Engineer, Americas
Sun Microsystems, United Kingdom
http://www.sun.com/mysql/

Thread
quot in MYSQL_FTPARSER_BOOLEAN_INFOAndrew Hutchings13 Nov
  • Re: quot in MYSQL_FTPARSER_BOOLEAN_INFOSergei Golubchik13 Nov
    • Re: quot in MYSQL_FTPARSER_BOOLEAN_INFOAndrew Hutchings13 Nov