I am trying to search in MySQL FT index for strings that start with 'Ford' to be able to find string like 'Ford', 'Ford1', 'Ford3', 'FordFord' etc... (this is why I am using '*'):
SELECT DISTINCT CARS.car
FROM CARS_FT_INDEX CARS_IDX
WHERE ( MATCH ( CAR_NAME ) AGAINST ( "/+FORD*/" IN BOOLEAN MODE) )
However, it's possible that the search term will contain '@' or other special character ("/+FORD@*/") which will resolve with the error message:
SQL Erorr (1064): syntax error, unexpected '@', expecting $end
I was suggested to surround the term with with '
('"/+FORD@*/"').
But the search term :AGAINST ( '"/+FORD@*/"' IN BOOLEAN MODE)
(with '@' and '') don't act as "start with" now (only exact match) and I am unable to search for multiple words ('"/+FORD1 +FIAT*/"').
I tried many variations (including CONCAT) and tried to search in google but couldn't find any solution here.
I will appreciate your advice here.
Thanks, Mike