matrixorigin / matrixorigin/matrixone

[Bug]: fulltext index: MATCH() AGAINST() function cannot be replaced by FULLTEXT INDEX and full table scan with fulltext search is not supported yet.

Open
#20,687 1 comment 0 reactions 1 assignee Claimed by @cpegeric View on GitHub
kind/bug severity/s0
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

### Is there an existing issue for the same bug?

- [X] I have checked the existing issues.

### Branch Name

main

### Commit ID

9c6ab9ec0

### Other Environment Information

```Markdown
- Hardware parameters:
- OS type:
- Others:
```

### Actual Behavior
场景1:
image

场景2:
image

### Expected Behavior

_No response_

### Steps to Reproduce

```Markdown
场景一:
drop table if exists articles;
drop table if exists authors;
create table articles (
id int auto_increment primary key,
title varchar(255),
content text,
author_id int,
fulltext(content)
);
create table authors (
id int auto_increment primary key,
name varchar(100)
);
insert into authors (name) values ('John Doe'), ('Jane Smith'), ('Alice Johnson');
insert into articles (title, content, author_id) values
('MO全文索引入门', 'MO全文索引是一种强大的工具,可以帮助你快速检索数据库中的文本数据。', 1),
('深入理解全文索引', '全文索引不仅可以提高搜索效率,还可以通过JOIN操作与其他表结合使用。', 2),
('MO性能优化', '本文将探讨如何优化MO数据库的性能,包括索引优化和查询优化。', 3),
('全文索引与JOIN操作', '全文索引可以与JOIN操作结合使用,以实现跨表的全文搜索。', 1);
select * from articles;
select * from authors;
select a.title, a.content, au.name
from articles a
join authors au on a.author_id = au.id
where match(a.content) against ('MO' IN NATURAL LANGUAGE MODE);

场景2:
drop table if exists posts;
drop table if exists comments;
create table posts (
post_id int auto_increment primary key,
title varchar(255),
content text
);
create table comments (
comment_id int auto_increment primary key,
post_id int,
comment_text text,
foreign key (post_id) references posts(post_id)
);
alter table posts add fulltext(content);
insert into posts (title, content) values
('MO全文索引入门', 'MO全文索引是一种强大的工具,可以帮助你快速检索数据库中的文本数据。'),
('深入理解全文索引', '全文索引不仅可以提高搜索效率,还可以通过JOIN操作与其他表结合使用。');
insert into comments (post_id, comment_text) values
(1, '这篇文章很有用,谢谢分享!'),
(1, '我也在学习全文索引,很有帮助。'),
(2, '全文索引真的很强大,学习了。');
select count(posts.title), count(comments.comment_id) as comment_count
from posts
left join comments on posts.post_id = comments.post_id
where match(posts.content) against ('全文索引' IN NATURAL LANGUAGE MODE)
group by posts.post_id;
```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.