I’ve setup a fulltext search to listen on the title and description columns for my blog articles table in MySQL. The SQL that I use to search the table is as follows:
SELECT title,description,publish_date FROM table WHERE MATCH(title,description) AGAINST(‘cats’,’dogs’) ORDER BY publish_date DESC LIMIT 100
This works (for ‘dogs’ and ‘cats’), but when I use the singular (‘dog’ or ‘cat’) then I find no results. Not sure why this is going on, I’ve tried different variations like “+dog, +cat” and tried including IN BOOLEAN MODE as well … Nothing works. And Yes I am sure that there are other words in the description column that are “dog” and “cat” as well as their plural versions.
How can I get singular words to work with MySQL?
The default minimum word length for full-text searches is 4 characters.
You’ll need to change that in the server configuration. See here for some info on how to do it.