Re: FTS and tri-grams

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Mark Phillips <mark(dot)phillips(at)mophilly(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: FTS and tri-grams
Date: 2021-01-05 22:05:51
Message-ID: AB5938B3-67DE-422D-9753-6A89AD57777F@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jan 5, 2021, at 13:26, Mark Phillips <mark(dot)phillips(at)mophilly(dot)com> wrote:
> 1. Is FTS required for tri-gram to work?
> 2. Are these independent of each other?
> 3. Is tri-gram alone sufficient for a “full text search” feature?

The answers are, kind of in order:

2. Yes.
1. No.
3. It depends on what you mean by "full text search."

Trigrams are mostly for fuzzy matching on a single or small number of words. There are things that the tsvector machinery can do that trigrams can't, such as proximity searches between words, prefix and stemmed searches, and things of that type. If you just want fuzzy searching on a small number of words, trigrams are probably fine; for more sophisticated kinds of searching, you want tsvector.

They're completely different sets of functionality in PostgreSQL.

--
-- Christophe Pettus
xof(at)thebuild(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Flatley 2021-01-05 22:10:21 RE: Max# of tablespaces
Previous Message Ron 2021-01-05 22:02:12 Re: Max# of tablespaces