pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christophe Pettus <xof@thebuild.com>
To: Mark Phillips <mark.phillips@mophilly.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: FTS and tri-grams
Date: Tue, 5 Jan 2021 14:05:51 -0800
Message-ID: <AB5938B3-67DE-422D-9753-6A89AD57777F@thebuild.com> (raw)
In-Reply-To: <C31F8FA1-C435-4930-AA69-E933FB290E1A@mophilly.com>
References: <C31F8FA1-C435-4930-AA69-E933FB290E1A@mophilly.com>



> On Jan 5, 2021, at 13:26, Mark Phillips <mark.phillips@mophilly.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@thebuild.com






view thread (3+ messages)  latest in thread

Message-ID: <AB5938B3-67DE-422D-9753-6A89AD57777F@thebuild.com>
Permalink:  ../AB5938B3-67DE-422D-9753-6A89AD57777F@thebuild.com/
Also on:    postgresql.org/message-id/AB5938B3-67DE-422D-9753-6A89AD57777F@thebuild.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: xof@thebuild.com, mark.phillips@mophilly.com
  Subject: Re: FTS and tri-grams
  In-Reply-To: <AB5938B3-67DE-422D-9753-6A89AD57777F@thebuild.com>
  References: <C31F8FA1-C435-4930-AA69-E933FB290E1A@mophilly.com> <AB5938B3-67DE-422D-9753-6A89AD57777F@thebuild.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox