Skip to content

[Bug]: fulltext index search 'string*' in boolean mode is not correct. #20958

Closed

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

0e2d0c1

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

查询为null
image

通过like模糊过滤出来的结果中有记录
image

Expected Behavior

No response

Steps to Reproduce

CREATE TABLE `fulltext_test` (
  `col1` bigint DEFAULT NULL,
  `col2` int NOT NULL,
  `col3` varchar(200) DEFAULT NULL,
  `col4` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`col2`),
 FULLTEXT(`col3`,`col4`) WITH PARSER ngram
);

load data local infile '/Users/ariznawl/Downloads/zhwiki-20241201-pages-articles-multistream-index.txt' into table test.fulltext_test fields terminated by ':' ESCAPED BY '\t' lines terminated by '\n';

select * from fulltext_test where match(col3,col4) against ('每日图片/2009年8月*' in boolean mode);

the txt file is huge, please contact me privately.

Additional information

No response

Activity

  1. added
    kind/bug
    severity/s0
    on Dec 26, 2024
  2. added this to the 2.1.0 milestone on Dec 26, 2024
  3. cpegeric commented on Jan 2, 2025

    @cpegeric
    Contributor

    probably, the sentence tokenize into something like 每曰图片/2009年8月 -> "每曰图 曰图片 图片 2 0 0 9 年 8 月"

    This test is not valid.

  4. Ariznawlll commented on Jan 7, 2025

    @Ariznawlll
    CollaboratorAuthor

    testing

  5. Ariznawlll commented on Jan 10, 2025

    @Ariznawlll
    CollaboratorAuthor

    当前mo中文搜索的处理逻辑是先去除所有的符号,然后进行搜索,因此bug中的搜索如下:

    mysql> select * from fulltext_test where match(col3,col4) against ('每日图片/2009年8月*' in boolean mode);
    Empty set (0.03 sec)
    
    mysql> select * from fulltext_test where col4 like '每日图片2009年8月%';   -->上面的搜索实际等价于这个搜索
    Empty set (0.61 sec)
    

    所以mo的结果符合预期

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugphase/testingseverity/s0

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions