In my product table there are data/names that have car as substring or as a whole word. Now I am searching for datas that has "car" on it. I am using LIKE keyword as below and results are fine.
product_name LIKE '%car%'
During testing i found that "cars" didn't return same results as "car" because datas didn't have 'cars' substring but car. Is there a technique where we could match closest to the keyword without maintaining/querying separate tables for words and synonyms etc?
product_name LIKE '%cars%'
Objective: If I am searching for 'cars' then i should be able to get results for cars, car, mars etc. Closest matches to given keyword from database. This is just an example. 'Keyword' is dynamic so i want closest matched results to keyword as explained in example of 'car'.
I have looked for various solutions. One solution was Levenshtein distance, that i maintain/external party for words and synonyms and apply levenshtein for closest relevant keyword and use them. This could be expensive for me. I was wondering if mysql has any native technique for this kind of matching pattern?