The issue
Long time user with an old issue, it seems that search appears to be broken in my installation. The API returns error 500 on discussion searches, however the user search function works. Here's the error in my log:
flarum.ERROR: PDOException: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list
I did some research on the issue, my forum was installed many years ago and have been upgraded successfully over time. I do understand that I'm missing some index based on this issue, but in all the topics on this issue I can't find any that explains how this index is supposed to look like. I tried adding a fulltext index for the content field in posts table:
ALTER TABLE posts ADD FULLTEXT INDEX `ft_content` (content);
But it seems to have no effect. The current indexes in my post table are:
- PRIMARY id
- UNIQUE discussion_id, number
- INDEX edited_user_id
- INDEX hidden_user_id
- INDEX discussion_id, number
- INDEX discussion_id, created_at
- INDEX user_id, created_at
- INDEX type
- INDEX type, created_at
Any ideas how I can create this missing index, or how it is supposed to look when it works?
Flarum information
Flarum core: 1.8.5
PHP version: 8.3.6
MySQL version: 10.11.6-MariaDB-0+deb12u1
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, apcu, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, igbinary, imap, intl, exif, mysqli, pdo_mysql, pdo_pgsql, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, yaml, zip, Zend OPcache