That is not supported in mysql. Mysql needs the left side of the string to do lookups in the index.
A hack I have been thinking about is to reverse all words in the search text and put them in the table as well. This does require you have a search table that is not the same as the home for the data. (Edit: thinking about it, you could just have a second field in the table that is included in the FullText index) In all my applications, I create a search table that has one TEXT field that holds all information I want to search on. This allows me to add related words, normalize terms (CD-ROM becomes CDROM).
I use PHP, so I would:
$text_to_index.= " ".strrev($text_to_index);
I could then insert that into the search table.
Then, when a user searches for a left side wildcard, I reverse it:
*_string
becomes:
gnirts_*
Its just an idea though. I have not tried it yet. It should work.
Brian Moon
Phorum Dev Team
http://phorum.org/
-----------------------
dealnews.com - How to go broke saving money.
http://dealnews.com/
Edited 1 time(s). Last edit at 12/07/2005 08:14AM by Brian Moon.