Use of match against with strings shorter than 4 characters
I am using MySQL queries based on "match against" for internal search engine. There is a full text index inside the database.
I like "match against" because results can be ordered by relevancy.
However, I see 2 cons :
- Strings shorter than 4 characters are ignored when requested
- Simple quotes (the " ' ") inside the database cause some disturbings in my case : words placed just before and after the quote are not considered as single words. Which means the data "... developer's ..." won't match with the query "developer".
Do you know any way to fix these 2 cons, especially the first one ?
Maybe I should use another type of syntax ?
you have to change the internal setting of mysql to achieve a shorter search string.
in my.cnf you have to add:
restart mysql with perhaps:
And rebuild your mysql fulltext index in mysql with:
repair table <table>
Thank you for your reply.
Does it mean it will "break" all de fulltext index of the database ?
yes you need to repair ALL the tables holding a fulltext index.
should work as well.
repair table <table> quick
OK, thank you for your help.
Since it may lead to side effects, I will ask the host admin to proceed.
By the way, do you have any solutions to force MySQL to consider simple quotes as word separators ?
Last edited by BillTrankill; 05-26-2011 at 04:27 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread