Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8780

fulltext index on innodb table doesn't honor ft_min_word_len

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0.21
    • N/A
    • None
    • Debian GNU/Linux 7.6 (wheezy) / mariadb 10.0.21

    Description

      innodb tables, doesn't use the ft_min_word_len, unlike myisam table, the ft_min_word_len, used by innodb table is always 4 (as the default value).

      ex:

      CREATE TABLE `ftx` (
        `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
        `_search` VARCHAR(250) DEFAULT NULL,
        PRIMARY KEY (`id`),
        FULLTEXT KEY `search` (`_search`)
      ) ENGINE=INNODB DEFAULT CHARSET=utf8;
       
      INSERT INTO ftx (_search) VALUES ('yi wu') ;
      INSERT INTO ftx (_search) VALUES ('yi wux') ;
      INSERT INTO ftx (_search) VALUES ('yi wuxo') ;

      mysql> SELECT * FROM ftx;
      +----+---------+
      | id | _search |
      +----+---------+
      |  1 | yi wu   |
      |  2 | yi wux  |
      |  3 | yi wuxo |
      +----+---------+

      mysql> SHOW VARIABLES LIKE 'ft_min_word_len';
      +-----------------+-------+
      | Variable_name   | Value |
      +-----------------+-------+
      | ft_min_word_len | 2     |
      +-----------------+-------+
      mysql> SELECT * FROM `ftx` WHERE (MATCH (_search) AGAINST ('wu')) ;
      Empty set (0.00 sec)

      and with isam table that's ok.

      DROP TABLE ftx;
      CREATE TABLE `ftx` (
        `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
        `_search` VARCHAR(250) DEFAULT NULL,
        PRIMARY KEY (`id`),
        FULLTEXT KEY `search` (`_search`)
      ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
       
      INSERT INTO ftx (_search) VALUES ('yi wu') ;
      INSERT INTO ftx (_search) VALUES ('yi wux') ;
      INSERT INTO ftx (_search) VALUES ('yi wuxo') ;

      mysql> SELECT * FROM `ftx` WHERE (MATCH (_search) AGAINST ('wu')) ;
      +----+---------+
      | id | _search |
      +----+---------+
      |  1 | yi wu   |
      +----+---------+
      1 row in set (0.00 sec)

      Attachments

        Activity

          People

            greenman Ian Gilfillan
            tophe Christophe Vigny
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.