Torus: PostgreSQL Search in Ecto
summary
Library Torus plugs Postgres search modes into Ecto so queries become a single Ecto line that can switch between pattern matching, trigram similarity, full‑text ranking, and semantic embedding search. It relies on Postgres features including the pgvector extension and GIN indexes, supports embedding providers (OpenAI, Hugging Face, Gemini, Postgres ML or local servers), and implements a batcher + cache pipeline to reduce API cost. Examples show fuzzy matches, prefix/full‑text ranking, and vector nearest neighbors all running inside Postgres with guidance on indexes and prefilters for speed.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:50What is Ecto
- 3:39Search types
- 4:08Pattern matching
- 6:15Similarity search
- 8:33Full text search
- 11:17Semantic search
- 14:47Embeddings
related talks
43mFull-Text-Search Explained from A to Z with French Food
28mElasticsearch-Quality Full-Text Search in Postgres via Tantivy
59mFull-text search - seek and ye shall find
48mFrom Text to Meaning: pgvector Transforms PostgreSQL Search
33mPostgres, the Best Tool You're Already Using
52mVector search is now boring, but PostgreSQL has ways to go
24mSearch From the Ground Up
34mFull-Text Search in PostgreSQL
