I'm wondering why my fulltext search isn't returning any results. To me this seems pretty straightforward, but alas it's not working. I'm far from a DBA, but looking at the EXPLAINed query, I see key_len
is zero, which seems odd.
I'm running MySQL 5.5.41
CREATE TABLE
CREATE TABLE `searchable_content` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`page_id` int(11) DEFAULT NULL,
`menu_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`content` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
FULLTEXT KEY `menu_title` (`menu_title`),
FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `content` (`content`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
Table content
+----+---------+------------+-------+------------------------------------------------+
| id | page_id | menu_title | title | content |
+----+---------+------------+-------+------------------------------------------------+
| 8 | 42 | Apps | Apps | <p>blah blah blah blah blabbity blah blah</p> |
+----+---------+------------+-------+------------------------------------------------+
Query
SELECT
page_id,
MATCH(`content`) AGAINST ('blabbity') AS 'relevance'
FROM
`searchable_content`
WHERE
MATCH(`content`) AGAINST ('blabbity');
That query EXPLAINed
+----+-------------+--------------------+----------+---------------+---------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------------+----------+---------------+---------+---------+------+------+-------------+
| 1 | SIMPLE | searchable_content | fulltext | content | content | 0 | | 1 | Using where |
+----+-------------+--------------------+----------+---------------+---------+---------+------+------+-------------+