Skip to content

[Bug]: bm25 retrieve - NATURAL LANGUAGE MODE doesn't work #23384

@shrmke

Description

@shrmke

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

dd9564b

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

  1. create a table;
    sql:create table bm25_results(id INT PRIMARY KEY,title VARCHAR(200),content TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
  2. create fulltext index;
    sql:CREATE FULLTEXT INDEX ftidx_content ON bm25_results;
  3. insert data;
    sql:INSERT INTO bm25_results (id, title, content) VALUES
    -> (1, '人工智能简介', '人工智能是计算机科学的一个分支...'),
    -> (2, '数据库原理', '数据库是组织和存储数据的系统...'),
    -> (3, '机器学习', '机器学习是人工智能的一个子领域...'),
    -> (4, '深度学习', '深度学习是机器学习的一个分支...');
    4.retrieve in default mode;
    sql:SELECT * FROM bm25_results WHERE MATCH(title, content) AGAINST('机器学习');
    +------+--------------+--------------------------------------------------+---------------------+
    | id | title | content | created_at |
    +------+--------------+--------------------------------------------------+---------------------+
    | 3 | 机器学习 | 机器学习是人工智能的一个子领域... | 2025-12-26 10:14:36 |
    | 4 | 深度学习 | 深度学习是机器学习的一个分支... | 2025-12-26 10:14:36 |
    +------+--------------+--------------------------------------------------+---------------------+
    2 rows in set (0.048 sec)
  4. retrieve in natural language mode;
    sql:SELECT * FROM bm25_results WHERE MATCH(title, content) AGAINST('机器学习是啥'IN NATURAL LANGUAGE MODE);
    Empty set (0.010 sec)

Expected Behavior

supposed to return
+------+--------------+--------------------------------------------------+---------------------+
| id | title | content | created_at |
+------+--------------+--------------------------------------------------+---------------------+
| 3 | 机器学习 | 机器学习是人工智能的一个子领域... | 2025-12-26 10:14:36 |
| 4 | 深度学习 | 深度学习是机器学习的一个分支... | 2025-12-26 10:14:36 |
+------+--------------+--------------------------------------------------+---------------------+

Steps to Reproduce

-

Additional information

No response

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't workingseverity/s0Extreme impact: Cause the application to break down and seriously affect the use

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions