MySQL full text with stems

I am creating a small search function for my site. I take my custom query, basing the keywords, and then running a full MySQL search with the keywords I search.

The problem is that MySQL treats stems as literals. Here is the process that happens:

  • the user is looking for the word "baseball"
  • my algorithm (Porter Stemmer) turns baseball into basebal.
  • fulltext does not find anything suitable "basebal", although there MUST be matches for "baseball" and "baseball".

How to make LIKE equivalent of 'basebal%' with full text?

EDIT:

Here is my current request:

SELECT MATCH (`title`,`body`) AGAINST ('basebal') AS `relevance`,`id` FROM `blogs` WHERE MATCH (`title`,`body`) AGAINST ('basebal') ORDER BY `relevance` DESC 
+4
source share
2 answers

I think it will work with an asterisk at the end: basebal* . For more information, see the * Operator * on this page .

+6
source

See this link .. Stemming is not installed by default in MySQL, but you can install it yourself ..

http://oksoft.blogspot.com/2009/05/stemming-words-in-mysql.html

0
source

All Articles