Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prefix and suffix wildcards in mysql full text search

My client insists on a search on multiple columns by any part of a string. So i'm trying to do this:

... MATCH(smth, smth2) AGAINST('*string*' IN BOOLEAN MODE)

Indexing or a fast search is not a requirement so even if MATCH.. AGAINST were to not use an index - it would be OK. But the problem is that the prefixed wildcard does not work - only the one after the word does:

*string* - will match the same as string* and *string does not match anything

Is there a way to resolve this problem with MYSQL? I'm really not going to install any indexing services or anything like that so slow queries will have to do.

I could try using LIKE on multiple columns somehow, but i imagine this would be even slower.

like image 367
Marius Avatar asked Dec 13 '12 10:12

Marius


1 Answers

Mysql fulltext search didn't allow us to use * as prefix in match against search..

Check this for reference:

http://dev.mysql.com/doc/refman/4.1/en/fulltext-boolean.html

like image 196
Aman Aggarwal Avatar answered Nov 02 '22 23:11

Aman Aggarwal