HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
eulerto
pg_similarity
C2019–2023
eulerto / pg_similarity

pg_similarity

set of functions and operators for executing similarity queries

3Distinct people
3Mentions
0Explicit recommenders
402GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

set of functions and operators for executing similarity queries

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year3 dated mentions

Observed mentions: 2019-10-20 04:51:28 UTC to 2023-02-07 19:25:13 UTC.

012019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101

What Hacker News says

3 sources
Note that pgvector isn't supported on any of the large cloud providers' hosted Postgres offerings, other than Supabase. https://github.com/pgvector/pgvector#hosted-postgres has instructions on how to add your voice to request it to be added! (It does seem that the ancient https://github.com/eulerto/pg_similarity is supported by RDS and Google Cloud - but it's hard to tell whether attention was paid to its performance characteristics with nearly the rigor that pgvector seems to have been designed.)
In Supabase Clippy – ChatGPT for Supabase Docs
While I don't doubt that you know your usecase and weighed/tried the option. > Postgres search is essentially an easier to use regex engine. I'm not sure exactly what you meant to convey here, but if you're searching with LIKE or `~` you're not doing Postgres's proper Full Text Search. You should be dealing with tsvectors[0] > As soon as you need multiple languages Postgres FTS supports multiple languages and you can create your own configurations[1] > advanced autocomplete I'm not sure what "advanced" autocomplete is but you can get pretty fast trigram searches going[2] (back to LIKE/ILIKE here but obviously this is an isolated usecase). In the end I'd expect auto complete results to actually not hit your DB most of the time (maybe I'm naive but that feels like a caching > cache invalidation > cache pushdown problem to me) > misspelling
Read the rest
detection pg_similarity_extension[3] might be of some help here, but it may require some wrangling. > large documents, large datasets, PG has TOAST[4], and obviously can scale (maybe not necessarily great at it) -- see pg_partman/Timescale/Citus/etc. > custom scoring Postgres only has basic ranking features[5], but you can write your own functions and extend it of course. Solr/ES are definitely the right tools for the job (tm) when the job is search, but you can get surprisingly far with Postgres. I'd argue that many usecases actually don't want/need a perfect full text search solution -- it's often minor features that turn into overkill fests and ops people learning/figuring out how to properly manage and scale an ES cluster and falling into pitfalls along the way. [0]: https://www.postgresql.org/docs/current/textsearch-intro.htm... [1]: https://www.postgresql.org/docs/current/textsearch-intro.htm... [2]: https://about.gitlab.com/blog/2016/03/18/fast-search-using-p... [3]: https://github.com/eulerto/pg_similarity [4]: https://www.postgresql.org/docs/current/storage-toast.html [5]: https://www.postgresql.org/docs/9.5/textsearch-controls.html...
In Official Elasticsearch Python library no longer works with open-source forks
After using this, metaphone and other interesting similarity metrics for data cleaning in OpenRefine, I was looking for a python library that had these sorts of similarity metrics. I found this quite interesting (and comprehensive) project that includes regular string distance (fuzzy search) methods, fingerprinting methods and a huge number of phonetic metrics including 7 different soundex methods: https://github.com/chrislit/abydos A few others worth mentioning: Scala: https://github.com/rockymadden/stringmetric Java/Scala: https://github.com/vickumar1981/stringdistance Postgres: https://github.com/eulerto/pg_similarity R: https://github.com/markvanderloo/stringdist Clojure: https://github.com/Yomguithereal/clj-fuzzy
In Soundex – a phonetic algorithm for indexing names by sound

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.