Re: Fuzzy string matching of product names

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Fuzzy string matching of product names
Date: 2010-04-09 13:47:19
Message-ID: m2d3y8kaag.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Leif Biberg Kristensen <leif(at)solumslekt(dot)org> writes:
> On Monday 5. April 2010 22.00.41 Peter Geoghegan wrote:
>> similar they sound. How can that actually be applied to get the
>> functionality that I've described?
>
> I've got a similar problem in my 18th century research, when clerks usually
> took pride in being able to spell a name in any number of ways. I've landed on
> a solution where I'm sending search strings to SIMILAR TO. I usually get far
> too many hits, but it's much easier to browse through 100 hits than the entire
> dataset which is approaching 60,000 records.

In both your cases I'd play with trigram search. The idea is dead simple
and it performs really well. It's the poor man's Full Text Search, but
for catalog look ups it's exactly what you want I suppose:

http://www.postgresql.org/docs/8.3/static/pgtrgm.html

Regards,
--
dim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Corin 2010-04-09 13:53:19 [Fwd: Re: fulltext search stemming/ spelling problems]
Previous Message Alan Millington 2010-04-09 10:46:37 When is an explicit cast necessary?