Search Postgresql Archives

Re: Fuzzy string matching of product names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/5/2010 3:00 PM, Peter Geoghegan wrote:
http://www.postgresql.org/docs/8.4/static/fuzzystrmatch.html

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

Fuzzystrmatch is generally used to compare two single words for how
similar they sound. How can that actually be applied to get the
functionality that I've described?

Regards,
Peter Geoghegan



You could use regexp_split_to_table to split words, then soundx each one, and find matching... assuming you have a table like:

andy=# select * from tmpx;
 id |      cname
----+-----------------
  1 | andy corp
  2 | cola corp
  3 | pepsi cola corp
  4 | bob inc
(4 rows)


(I dont have the soundx stuff installed, so I'll uppercase instead)

andy=# select id from (select id, upper(regexp_split_to_table(cname, E'\\s+')) as sndx from tmpx) as foo where sndx = 'CORP';
 id
----
  1
  2
  3
(3 rows)


and actually, you probably want "select distinct id from..."

-Andy

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux