Re: Fuzzy string matching of product names

Поиск
Список
Период
Сортировка
От Andy Colson
Тема Re: Fuzzy string matching of product names
Дата
Msg-id 4BBB4BC5.7080808@squeakycode.net
обсуждение исходный текст
Ответ на Re: Fuzzy string matching of product names  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Björn Lindqvist
Дата:
Сообщение: Re: Completely wrong row estimates
Следующее
От: David Kerr
Дата:
Сообщение: Re: Connection Pooling