Solved

How can I search a MYSQL database for names while accounting for spelling mistakes?

Posted on 2009-06-30
1
448 Views
Last Modified: 2012-05-07
I have a rails app that makes use of user profiles.  I want to let users search for profiles by name.  If a user miss-spells a name the search should sill return the name.  I'm not looking for something too complicated (a rails plug-in would be ideal) but .Find(:name like ?, '%' + param[:search] + '%') just isn't enough.  I would like something a little smarter.  Are there any standard algorithms for this kind of search?  Should I use a regex?

Ideally, if a user exists with the last name smith and someone searches for smigh, I'd like to return smith.  If this isn't possible then I can live with what I got.
0
Comment
Question by:skm376
1 Comment
 
LVL 46

Accepted Solution

by:
tbsgadi earned 500 total points
ID: 24752345
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

856 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