Marius
Marius

Reputation: 4016

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.

Upvotes: 6

Views: 4494

Answers (1)

Aman Aggarwal
Aman Aggarwal

Reputation: 18439

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

Upvotes: 4

Related Questions