[groonga-dev,01348] Re: AGAINST("") でmysqlがclushする

Back to archive index

N.K. nakai****@gmail*****
2013年 4月 30日 (火) 17:19:16 JST


須藤さん


お世話になります、中井です。

早急にご確認いただきありがとうございます!

ただ、回避策のスペースを入れて検索した場合の挙動も不思議なものがありました。

特定の文字によるものではないようで"あ"でも"う"でも"東京"でも発生するようです。

※発生しないときもあります。


■再現方法

truncate table diaries;
Query OK, 0 rows affected (0.08 sec)

select * from diaries;
Empty set (0.00 sec)

insert into diaries(content) values ("あ");
Query OK, 1 row affected (0.01 sec)

select * from diaries where MATCH(content) AGAINST(" ");
+----+---------+
| id | content |
+----+---------+
|  1 | あ      |
+----+---------+
1 row in set (0.00 sec)

↑"あ"が検索対象になる。

truncate table diaries;
Query OK, 0 rows affected (0.06 sec)

insert into diaries(content) values ("い");
Query OK, 1 row affected (0.01 sec)

select * from diaries where MATCH(content) AGAINST(" ");
Empty set (0.00 sec)

insert into diaries(content) values ("う");
Query OK, 1 row affected (0.01 sec)

select * from diaries where MATCH(content) AGAINST(" ");
+----+---------+
| id | content |
+----+---------+
|  2 | う      |
+----+---------+
1 row in set (0.00 sec)

↑うが検索対象になる。

truncate table diaries;
Query OK, 0 rows affected (0.03 sec)

insert into diaries(content) values ("う");
Query OK, 1 row affected (0.01 sec)

select * from diaries where MATCH(content) AGAINST(" ");
Empty set (0.00 sec)

↑うが検索対象にならない。



※回避策として空文字、スペースのみ場合は、検索させないようにします。


よろしくおねがいします。



groonga-dev メーリングリストの案内
Back to archive index