I've got a table product and the user needs to be able to search through products using an autocomplete function on a text field. But I want also when people make little mistakes in the name, it gets found aswell.
What is needed
All my titles are formated like this: [brand] [productnamename] [versionname] So for example, I've got a product 'foo evo HD3455' i need to find it when i type 'foo' or 'evo' or 'HD2455' or parts of it, but also when they type 'froo eno HD3455' for example they need to find it aswell
What i have
I have this SQL query:
SELECT * FROM `product` WHERE SOUNDEX(title) LIKE CONCAT('%',SUBSTRING(SOUNDEX('here the search text'),2),'%')
Whats not working
It works for the brands, even if you make a little mistake in the name, but when I search for the [productname] or [versionname], then it does't work. When i type the [brand] first and then the [versionname] the results with the [versionname] in it don't show up.
Where i need it for
I'm going to use it for an autocomplete field, so that users can easily find products, even if they make a mistake in their search text.
I can't use fulltext search because i use innoDB