troubleshooting Question

MySQL Soundex Query for Term that Sounds Like Any Portion of the Field

Avatar of FrankTech
FrankTech asked on
MySQL Server
7 Comments1 Solution1399 ViewsLast Modified:
I am trying to make a MySQL query that will find a row if any portion of column1 sounds like the search term.
  E.g., in English, "Find the row where *any* of the words in column1 sounds like 'would '."

 For example, in

   column1 =  "The Book Was Read."

Querying for 'red'  should retrieve that row, because "read" can sound like "red", and the sound of "red" is *somewhere within* column1.  Another example:

   Searching for "would"  should retrieve the following row, because it has a word with that kind of sound, *somewhere* within column1:   "Strong Oak Wood" .

I tried this query, but it does not work:
   SELECT column1 FROM table WHERE column1 SOUNDS LIKE '%$searchTerm%'

This does not work either:
   SELECT column1 FROM table WHERE Soundex(column1) LIKE Soundex('%$searchTerm%')";

I guess it's obvious that those would not work.  So what query can find a "sound-alike" anywhere within column1 ?
ASKER CERTIFIED SOLUTION
Kim Ryan
IT Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros