Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwuSo-0002Bt-FG for pgsql-general@arkaria.postgresql.org; Tue, 05 Jan 2021 22:06:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kwuSn-0003Y6-DD for pgsql-general@arkaria.postgresql.org; Tue, 05 Jan 2021 22:06:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwuSm-0003Xz-K4 for pgsql-general@lists.postgresql.org; Tue, 05 Jan 2021 22:06:00 +0000 Received: from smtp100.ord1d.emailsrvr.com ([184.106.54.100]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwuSf-0000Xu-PM for pgsql-general@lists.postgresql.org; Tue, 05 Jan 2021 22:05:58 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp5.relay.ord1d.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 9F2ECA02BC; Tue, 5 Jan 2021 17:05:52 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.5\)) Subject: Re: FTS and tri-grams From: Christophe Pettus In-Reply-To: Date: Tue, 5 Jan 2021 14:05:51 -0800 Cc: pgsql-general Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Mark Phillips X-Mailer: Apple Mail (2.3445.9.5) X-Classification-ID: 1d1ba48c-98dd-47e2-a042-30810dc94f08-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Jan 5, 2021, at 13:26, Mark Phillips = 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 =E2=80=9Cfull text search=E2=80=9D= 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