Live data from Hacker News

Fuzzy Name Matching in Postgres

info.crunchydata.com

21–22 of 22 posts

Re: Fuzzy Name Matching in Postgres

#21
post #8

Surprised there's no mention of pg_trgm for trigram-based fuzzy match. I guess for English names, Soundex is fairly good. https://www.postgresql.org/docs/current/pgtrgm.html

is it?

> At present, the soundex, metaphone, dmetaphone, and dmetaphone_alt functions do not work well with multibyte encodings (such as UTF-8).

I#m not sure but most postgres databases use utf-8

Re: Fuzzy Name Matching in Postgres

#22

the biggest issue is postgres not having tf-idf or BM25 style relevance algorithms. that would have been the right fit for fuzzy name matching.

TF-IDF algorithms like BM25 do not come built in, but are straightforward to implement on top of postgres' text search: https://www.alibabacloud.com/blog/keyword-analysis-with-post... The key is you have to compute the IDF into a side table using the ts_stat function, since this is a global property (inter-document frequency) of your corpus. Once you have your IDF table you can write a ranking function based on that…

performance. that's the issue.

the Alibaba Cloud article is nice..but we are really comparing this with Elastic

Post reply on HN