Search & IndexingTechnical Definition

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.

Core Technical Definition

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.

Explore Free Tools →