I'm using XAMPP 8.1.10 on Windows 10 with InnoDB tables, and I'm trying to create a MariaDB table with a FULLTEXT index using the ngram parser to support searching in Chinese, Japanese and Korean languages.
When I try to do it, even using the exact example command from MySQL's own website, it gives this error in PHPMyAdmin:
Error
Static analysis:
1 errors were found during analysis.
A comma or a closing bracket was expected. (near "WITH" at position 158)
SQL query: Copy
CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) WITH PARSER ngram ) ENGINE=InnoDB CHARACTER SET utf8mb4;
MariaDB said: Documentation
#1128 - Function 'ngram' is not defined
The example command is this:
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT (title,body) WITH PARSER ngram
) ENGINE=InnoDB CHARACTER SET utf8mb4;
If I remove the " WITH PARSER ngram" from the FULLTEXT line, it works without errors, but of course isn't going to use the ngram parser. Using the ALTER TABLE command also doesn't work:
ALTER TABLE articles ADD FULLTEXT INDEX ft_index (title,body) WITH PARSER ngram;
giving this error:
Error
Static analysis:
1 errors were found during analysis.
A new statement was found, but no delimiter between it and the previous one. (near "WITH" at position 62)
SQL query: Copy
ALTER TABLE articles ADD FULLTEXT INDEX ft_index (title,body) WITH PARSER ngram;
MariaDB said: Documentation
#1128 - Function 'ngram' is not defined
Is the ngram parser not installed in XAMPP, or am I doing something else wrong?
Edit: Apparently XAMPP uses MariaDB despite it saying MySQL in the XAMPP Control Panel and in the error messages. MariaDB doesn't support the ngram parser yet. Solved by swapping MariaDB for MySQL in XAMPP using this guide https://stackoverflow.com/a/58973750/20394214
Apparently XAMPP uses MariaDB despite it saying MySQL in the XAMPP Control Panel and in the error messages. MariaDB doesn't support the ngram parser yet. Solved by swapping MariaDB for MySQL in XAMPP using this guide https://stackoverflow.com/a/58973750/20394214