Commit 6e901a76 authored by unknown's avatar unknown

phrase search parser bug

parent baab8387
...@@ -166,6 +166,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ...@@ -166,6 +166,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
if ((ftbe->quot=param.quot)) ftb->with_scan|=2; if ((ftbe->quot=param.quot)) ftb->with_scan|=2;
if (param.yesno > 0) up->ythresh++; if (param.yesno > 0) up->ythresh++;
_ftb_parse_query(ftb, start, end, ftbe, depth+1); _ftb_parse_query(ftb, start, end, ftbe, depth+1);
param.quot=0;
break; break;
case 3: /* right bracket */ case 3: /* right bracket */
if (up->quot) up->qend=param.quot; if (up->quot) up->qend=param.quot;
......
...@@ -134,7 +134,7 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param) ...@@ -134,7 +134,7 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
{ {
if (true_word_char(*doc)) break; if (true_word_char(*doc)) break;
if (*doc == FTB_RQUOT && param->quot) { if (*doc == FTB_RQUOT && param->quot) {
param->quot=doc-1; param->quot=doc;
*start=doc+1; *start=doc+1;
return 3; /* FTB_RBR */ return 3; /* FTB_RBR */
} }
......
...@@ -70,6 +70,16 @@ Full-text search in MySQL implements vector space model 0 ...@@ -70,6 +70,16 @@ Full-text search in MySQL implements vector space model 0
select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE);
a b a b
MySQL has now support for full-text search MySQL has now support for full-text search
select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOLEAN MODE);
a b
MySQL has now support for full-text search
Full-text search in MySQL implements vector space model
select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE);
a b
Full-text search in MySQL implements vector space model
select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE);
a b
MySQL has now support for full-text search
select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE); select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE);
a b a b
Full-text search in MySQL implements vector space model Full-text search in MySQL implements vector space model
......
...@@ -34,6 +34,9 @@ select *, MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE) as x from t1 ...@@ -34,6 +34,9 @@ select *, MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE) as x from t1
select *, MATCH(a,b) AGAINST("collections support" IN BOOLEAN MODE) as x from t1; select *, MATCH(a,b) AGAINST("collections support" IN BOOLEAN MODE) as x from t1;
select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE);
# boolean w/o index: # boolean w/o index:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment