对于mysql或mariaDB,布尔搜索确实不会按相关性顺序返回?
我已经检查了两个文档(对于mysql和mariaDB最新版本):
对于布尔模式,搜索不会按照相关性顺序返回! https://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html https://mariadb.com/kb/en/mariadb/fulltext-index-overview/
但是当我测试它时,它是按相关性排序的! 我跑了一些测试,并且按照MATCH的回归进行排序(我相信这是相关性,对!)! 文档是否过时? 或者我错过了什么?
测试10.1.25-MariaDB
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(id INT PRIMARY KEY,c1 varchar(30),FULLTEXT(c1));
INSERT INTO t1(id,c1) VALUES
(1,'aaa'),
(2,'aaa bbb ccc'),
(3,'aaa bbb');
SET @a='aaa bbb ccc';
SELECT id
FROM t1 WHERE
MATCH(c1) AGAINST(@a IN BOOLEAN MODE); # 2,3,1
SELECT id, MATCH(c1) AGAINST(@a IN BOOLEAN MODE) as rev
FROM t1 WHERE
MATCH(c1) AGAINST(@a IN BOOLEAN MODE) ORDER BY rev DESC; # 2,3,1
链接地址: http://www.djcxy.com/p/75297.html
上一篇: For mysql or mariaDB, Boolean search really does not return in relevance order?
下一篇: Sorting Boolean Fulltext Searches by Relevance in MySQL, Explained?