1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

phrase search

This commit is contained in:
serg@serg.mysql.com
2002-04-18 14:12:29 +00:00
parent 08384a3abd
commit 3cc69d5a64
5 changed files with 77 additions and 27 deletions

View File

@ -133,13 +133,20 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
for (;doc<end;doc++)
{
if (true_word_char(*doc)) break;
if (*doc == FTB_LBR || *doc == FTB_RBR)
if (*doc == FTB_RQUOT && param->quot) {
param->quot=doc-1;
*start=doc+1;
return 3; /* FTB_RBR */
}
if ((*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT)
&& !param->quot)
{
/* param->prev=' '; */
*start=doc+1;
if (*doc == FTB_LQUOT) param->quot=*start;
return (*doc == FTB_RBR)+2;
}
if (param->prev == ' ')
if (param->prev == ' ' && !param->quot)
{
if (*doc == FTB_YES ) { param->yesno=+1; continue; } else
if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else
@ -149,7 +156,8 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; }
}
param->prev=*doc;
param->yesno=param->plusminus=param->pmsign=0;
param->yesno=(param->quot != 0);
param->plusminus=param->pmsign=0;
}
mwc=0;