Trigram Fuzzy Matching (pg_trgm)
Trigram matching breaks text into 3-character slices, allowing search engines to match queries even when visitors make typos or misspellings.
Trigram search is a substring indexing technique that decomposes words into three-character tuples to compute similarity and match queries despite spelling mistakes and typos.
How Trigram Search works in practice
The word “pricing” decomposes into trigrams: `[" pr", "pri", "ric", "ici", "cin", "ing", "ng "]`. A misspelled query like “prizing” shares 5 of those 7 trigrams.
By calculating the percentage of overlapping trigrams, the system matches user questions even when typed with common mobile typos.
How SiteMind implements Trigram Search
SiteMind uses PostgreSQL `pg_trgm` GIN indexes so visitors who misspell product names or commands still receive accurate answers.
Test our AI tools in your browser (100% Free)
Estimate support savings, token counts, or test prompt injection security guardrails with our zero-cost sandboxes.
Related Technical Concepts
Hybrid Search (Dense + Sparse Retrieval)
Hybrid Search merges dense vector search with sparse keyword matching to deliver superior accuracy across both conceptual and exact-term queries.
Full-Text tsvector Indexing
tsvector is PostgreSQL’s native text search type that parses, stems, and indexes words for lightning-fast lexical keyword searching.
Reciprocal Rank Fusion (RRF)
Reciprocal Rank Fusion (RRF) is an algorithmic scoring method that merges and ranks search results from multiple independent retrieval pipelines.
Test it on your own website in under 2 minutes.
Enter your domain to index your pages and preview live answers.