这很可能是 50% 噪声的情况。当你有一个单词在 50% 或更多的行中时,mysql 认为它是一个干扰词,并且在评分时会忽略它(因此排名)。这仅适用于该NATURAL LANGUAGE MODE
选项。
不要吹毛求疵,但它应该工作得很好,没有任何引号:
mysql> select * from table1;
+---------+------+------+-------------+
| autonum | ID | name | metavalue |
+---------+------+------+-------------+
| 1 | 1 | Rose | Drinker |
| 2 | 1 | Rose | Nice Person |
| 3 | 1 | Rose | Runner |
| 4 | 2 | Gary | Player |
| 5 | 2 | Gary | Funny |
| 6 | 2 | Gary | NULL |
| 7 | 2 | Gary | Smelly |
+---------+------+------+-------------+
7 rows in set (0.00 sec)
mysql> select ID, group_concat(coalesce(metavalue,'Empty')) as Test from table1 group by ID order by Test;
+------+----------------------------+
| ID | Test |
+------+----------------------------+
| 1 | Drinker,Nice Person,Runner |
| 2 | Player,Funny,Empty,Smelly |
+------+----------------------------+
2 rows in set (0.01 sec)
mysql> select ID, group_concat(coalesce(metavalue,'Empty')) as Test from table1 group by ID order by Test desc;
+------+----------------------------+
| ID | Test |
+------+----------------------------+
| 2 | Player,Funny,Empty,Smelly |
| 1 | Drinker,Nice Person,Runner |
+------+----------------------------+
2 rows in set (0.00 sec)
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)
(并且这种查询在我的 Windows 5.1.x 安装中也可以正常工作)