Go Back   Forum Care Forums > Development Reference Area > MySQL Discussion

Reply
 
LinkBack Thread Tools Display Modes
Searching a DB
Old
  (#1)
UKuser
Guest
 
Posts: n/a
Default Searching a DB - 06-04-2007, 07:58 AM

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

Re: Searching a DB
Old
  (#2)
Ravi
Guest
 
Posts: n/a
Default Re: Searching a DB - 06-04-2007, 07:58 AM

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
Re: Searching a DB
Old
  (#3)
UKuser
Guest
 
Posts: n/a
Default Re: Searching a DB - 06-04-2007, 07:58 AM

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
Re: Searching a DB
Old
  (#4)
PeterD
Guest
 
Posts: n/a
Default Re: Searching a DB - 06-04-2007, 07:58 AM

UKuser <EMAIL REMOVED> 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
Re: Searching a DB
Old
  (#5)
UKuser
Guest
 
Posts: n/a
Default Re: Searching a DB - 06-04-2007, 07:58 AM

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top