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

fulltext index on innodb table doesn't honor ft_min_word_len

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.0.21
    • Fix Version/s: N/A
    • Labels:
      None
    • Environment:
      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)
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            It is not a bug on the server side. ft_min_word_len is a MyISAM fulltext-search option, InnoDB has its own: innodb_ft_min_token_size.

            But we do need to update documentation to mention that ft_min_word_len (and some other options) are MyISAM-specific. MySQL has already done it in their manual.

            Show
            elenst Elena Stepanova added a comment - It is not a bug on the server side. ft_min_word_len is a MyISAM fulltext-search option, InnoDB has its own: innodb_ft_min_token_size . But we do need to update documentation to mention that ft_min_word_len (and some other options) are MyISAM-specific. MySQL has already done it in their manual .
            Hide
            greenman Ian Gilfillan added a comment -

            The documentation has now been updated.

            Show
            greenman Ian Gilfillan added a comment - The documentation has now been updated.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: