I have a table to store book titles. Whenever I insert a new title I would like to check, if the title already exists. The problem is that, due to typos, an exact match is not possible.
For example
'My Dream of Wonder Land'
'My Deam of Wonder Land'
So my goal is to create Tags for each title, with every book having at most 3 tags. These tags are the 3 longest words of the title:
'My Dream of Wonder Land' = dream, wonder, land
'My Deam of Wonder Land'= deam, wonder, land
Now when I add a title, I would like to find all titles, with at least two matching tags. The order of tags should be ignored, meaning that
'land, dream, lego'
Should match as well.
What would be the best way to store the data in MySQL?