Reputation: 19989
I have a table where there are video data, like "title", "description" etc. I'm trying to write a search engine with MySQL fulltext indexing. The SQL query works with some words but not every word. Here is my SQL query;
SELECT *
FROM videos
WHERE MATCH (title, description) AGAINST ('XXXXXXXXXX' IN NATURAL LANGUAGE MODE)
where I replace "XXXXXXXX" with the query terms. It works with "otomotiv" but not with "otomoti". Doesn't it have to find "otomoti" if it finds "otomotiv", as "otomoti" is part of the whole word "otomotiv"?
I tried changing the search mode to "IN NATURAL LANGUAGE MODE" or "WITH QUERY EXPANSION" but still no luck.
Is it normal that MySQL can't find a part of the whole word?
Upvotes: 0
Views: 1022
Reputation: 6082
You need to perform boolean full text search as it supports wildcard operator.
http://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html
SELECT *
FROM videos
WHERE MATCH (title, description) AGAINST ('otomoti*' IN BOOLEAN MODE)
Upvotes: 2