Given a very large database of product names, how would you detect possible typos in user searches and suggest possible corrections (Kinda like the way Google presents them)?
E.g.
User enters "fork handels" and presses 'search'.
They get back
"No results. Did you mean 'fork handles'?"
You could use a phonetic algorithm, such as Soundex to find matches that sound similar.
PostgreSQL has a module named fuzzystrmatch, with the docs showing examples of using Soundex, Levenshtein, Metaphone, and Double Metaphone.
I'm sure I read that google keeps a list of what a user retypes when they get no results. You could keep a mapping of these values (say if the retyped string begins with the same letter).
There are several approaches for this problem: