Re: Compare strings which resembles each other

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
Cc: Gulshan Babajee <gulshan(dot)babajee(at)parabolemaurice(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Compare strings which resembles each other
Date: 2003-11-21 14:32:37
Message-ID: Pine.GSO.4.58.0311211730170.13158@ra.sai.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, 21 Nov 2003, Christoph Haller wrote:

> >
> > Hy, I have a table containing some rows. Each row contains a field name
> > which is of type String.
> >
> > For example:
> > in row1 string1 is "Adieu Poulet",
> > in row2 string2 is "Adieu a Poulet",
> > in row3 string3 is "Adiue Poulet",
> > in row4 string4 is "Adieu Pouleet", etc..
> > (That is each string resembles each other a bit, they are somewhat similar
> > to each other)
> >
> > What type of query should I make so as it return me all these string. That
> > is I watn a query which return me strings which are similar or somewhat
> > similar to each other.
> >
> > thanks in advance
> > gulshan
> >
> $PGSQLD/contrib/tsearch/README.tsearch
> is your friend.

I think tsearch(2) isn't what Gulshan need. He needs fuzzy search,
there are several modules in contrib directory (metaphone, fuzzystrmatch).
Also, we have trgm module which uses trigram and has index support.

>
> Regards, Christoph
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christoph Haller 2003-11-21 15:22:57 Re: Compare strings which resembles each other
Previous Message Christoph Haller 2003-11-21 11:05:57 Re: Need another way to do this, my sql much to slow...