Question

I've been using a LIKE query for searching a search string in a knowledge base site. So, the term "phone" would likely turn up all pages that have something with the word "phone" written in it, logically.

But when getting into less typical searches, like "phone call", "phonecall", "phone-call", I start getting into the territory where the LIKE query stops working as well.

Someone recommended SOUNDEX to me, so that way I could catch not only exact matches, but similar matches.

Is this a proper use of SOUNDEX? is there something more appropriate?

Was it helpful?

Solution

If it is a column that just contains the words phonecall or similar, then yes, that is a good use of SOUNDEX, because you are looking for strings that sound the same but are spelled differently. If you are looking in a huge body of text, then it is less appropriate, as you would have to break the text into words before generating SOUNDEX, so this would fail on two-word versions like "phone call".

For an improved algorithm, I suggest you look into Double Metaphone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top