Unix Technical Forum

Searching a DB

This is a discussion on Searching a DB within the MySQL forums, part of the Database Server Software category; --> Hi, I have created a search script using the phrase LIKE '%input%' but it fails if you are really ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 09:54 AM
UKuser
 
Posts: n/a
Default Searching a DB

Hi,

I have created a search script using the phrase LIKE '%input%' but it
fails if you are really looking for Correct-Name but type in:

Correctname
Correct Name
Correct- Name

Is there a way to search maybe returning results by its levenshtein
status for example, or am I missing something more simple? How can I
search for this so that searching for any of the above 3 will
definitely return Correct-Name?

Thanks

A

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 09:54 AM
Ravi
 
Posts: n/a
Default Re: Searching a DB

Use REGEXP method in query
ex:
SELECT 'Monty!' REGEXP 'm%y%%';

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 09:54 AM
UKuser
 
Posts: n/a
Default Re: Searching a DB

On 24 May, 13:51, Ravi <Ravindrayep...@gmail.com> wrote:
> Use REGEXP method in query
> ex:
> SELECT 'Monty!' REGEXP 'm%y%%';


Hi,

I'm not quite sure how that would fit into the example I've given??

Thanks

A

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 09:54 AM
PeterD
 
Posts: n/a
Default Re: Searching a DB

UKuser <spidercc21@yahoo.co.uk> wrote:

> Hi,
>
> I have created a search script using the phrase LIKE '%input%' but it
> fails if you are really looking for Correct-Name but type in:
>
> Correctname
> Correct Name
> Correct- Name
>
> Is there a way to search maybe returning results by its levenshtein
> status for example, or am I missing something more simple? How can I
> search for this so that searching for any of the above 3 will
> definitely return Correct-Name?


soundex('correctname') is the same as soundex('correct-name') etc.

--
Pd
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 09:54 AM
UKuser
 
Posts: n/a
Default Re: Searching a DB

On 24 May, 14:33, pd.n...@dsl.pipex.invalid (PeterD) wrote:
> UKuser <spiderc...@yahoo.co.uk> wrote:
> > Hi,

>
> > I have created a search script using the phrase LIKE '%input%' but it
> > fails if you are really looking for Correct-Name but type in:

>
> > Correctname
> > Correct Name
> > Correct- Name

>
> > Is there a way to search maybe returning results by its levenshtein
> > status for example, or am I missing something more simple? How can I
> > search for this so that searching for any of the above 3 will
> > definitely return Correct-Name?

>
> soundex('correctname') is the same as soundex('correct-name') etc.
>
> --
> Pd


Thank you PD - very useful avenue!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:54 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com