Tutorial :mysql search prepending “the” or “and/&” ambiguity


I'm trying to do a title search in mysql across two different databases to match up data from seperate sources. In both db1 or db2, the titles will sometimes start with "The first title" in one db, and just "first title" in the other db, or "far and away" vs "far & away".

Mysql fulltext search doesn't seem very effective at figuring this out. I currently do just a straight match "WHERE title1=title2", but this of course misses any connection where there is slight differences in the title.

The only solution I have come up with is to run through a series of if statements checking if either of the titles contains "the" or "&".

This isn't a horrible way of doing it, but I assume there is a more efficient method to write my query to handle these issues.

Any ideas? So far my online searches have been fruitless. Thanks


Do you have the luxury of a preprocessing step? If you do, you might consider canonicalizing the titles on the two databases before comparing them.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »