views:

28

answers:

1

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

+1  A: 

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.

DDaviesBrackett
pedalpete
oh yes, now I remember why that wasn't top of the list. Pre-processing supposes that I have both titles out of the database to compare them, or do you mean 'pre-processing' as before the titles go into the database?
pedalpete
DDaviesBrackett