pg_trgm
A trigram similarity extension for PostgreSQL that enables fuzzy matching and similarity computation by splitting text into trigrams, commonly used to handle spelling errors and approximate search scenarios.
Timeline (last 90 days)
Multica 后端使用 Go 配 Chi 路由和 SQLC 数据库访问,实时通信使用 Gorilla WebSocket,数据库为 PostgreSQL 17 加 Crypto 和 pg_trgm 扩展,前端为 Next.js,并用 Electron 和 Expo/React Native 分别做桌面端和移动端。
pg_trgm is an official PostgreSQL extension that splits a string into trigrams made of three consecutive characters, and by comparing the proportion of trigrams shared by two strings it calculates a similarity score between 0 and 1, thereby tolerating typos, missing characters, or reversed word order.
LectuLibre builds a gin_trgm_ops index on books.title, and at query time filters with similarity(Book.title, q) > 0.3 and sorts by similarity, reducing fuzzy title search from 1.2s to 15ms.
All Facts (3)
Multica 后端使用 Go 配 Chi 路由和 SQLC 数据库访问,实时通信使用 Gorilla WebSocket,数据库为 PostgreSQL 17 加 Crypto 和 pg_trgm 扩展,前端为 Next.js,并用 Electron 和 Expo/React Native 分别做桌面端和移动端。
50%Unverifiedpg_trgm is an official PostgreSQL extension that splits a string into trigrams made of three consecutive characters, and by comparing the proportion of trigrams shared by two strings it calculates a similarity score between 0 and 1, thereby tolerating typos, missing characters, or reversed word order.
50%UnverifiedLectuLibre builds a gin_trgm_ops index on books.title, and at query time filters with similarity(Book.title, q) > 0.3 and sorts by similarity, reducing fuzzy title search from 1.2s to 15ms.
50%