Solved

Using SOUNDEX to match individual words within Text fields

Posted on 2007-04-10
6
749 Views
Last Modified: 2008-01-09
I have a table which contains  a Text fields containing course information.

I am constructing a 'fuzzy search' stored procedure which will match words within this field based on what was entered into a web front end.

The part I am finding difficulty with is matching on mis-spelled words

I thought I could use SOUNDEX for this but it only appears to be finding matches where the first word of the Text field is the word I am looking for.

So, for example, my search value is 'compter course' (note it is mis-spelled)

There are records in my DB which have text field value of 'Computers for beginners' and 'An introduction to computers'

My SOUNDEX query partly does the job but only the first record is matched :(

Is there a way to use SOUNDEX across all words in the text field or is ther another approach I can look at?

I am using SQL 2005

Thanks
0
Comment
Question by:WNottsC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 11

Expert Comment

by:Ved Prakash Agrawal
ID: 18881525
http://databases.about.com/od/development/l/aasoundex.htm

just try to look this may help you.. not sure it wil solve your problem or not..
I am looking your problem and give the feedback very soon...

0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 200 total points
ID: 18881529
you cannot use soundex efficiently for this.
you might consider using full-text search for this kind of query.
look up
CONTAINS
CONTAINSTABLE
FREETEXTTABLE
in the books online.
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 18881547
<<you cannot use soundex efficiently for this.>>
Agreed.  I would also ask: why use soundex at all.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 50

Accepted Solution

by:
Lowfatspread earned 300 total points
ID: 18881639
you can use soundex for some limited "misspelled word"  problems but i agree with angelliii and racimo its usage will not be easy ...

you need to filter for noise words and build soundex values for each remaining word and compare those...

full text searching is probably a better solution these days...

however your problem really seems  to stem from allowing a free format input in the firstplace... if your are really trying to allow for searching a course catalogue
why is a simple cross reference / category selection not the simplest approach...

ie type the course to an agreed set of course key words   COMPUTING / BASIC / PROGRAMMING / THEORY / ....

then just let the userr select from the defined set of Keywords...

0
 

Author Comment

by:WNottsC
ID: 18881815
Thanks

My SP uses all the other methods mentioned above already, none of them produce a match on 'compting' except soundex.  I already do some tidying up of noise words etc as well, the SP is growing into a bit of a monster.

I agree the design of the DB & application is not perfect but its what I've been given to work with
0
 

Author Comment

by:WNottsC
ID: 18896180
Update

Fortunately the data used here is only refreshed every few weeks so Ive created an overnight which splits the words in the search field into separate fields in a new table, then a soundex match is performed on each field in turn.

Hopefully this will catch enough typos to let us escape creating a thesaurus which I really, really want to avoid
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question