pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dan Langille <dan@langille.org>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: tsvector not giving expected results on one host
Date: Sat, 17 Dec 2022 14:55:31 -0500
Message-ID: <4006202.1671306931@sss.pgh.pa.us> (raw)
In-Reply-To: <9f89f00a-e400-4a9b-803b-f84999b6ffca@app.fastmail.com>
References: <2797dd29-aebb-43a2-9fd7-63bd77a944b2@app.fastmail.com>
	<9f89f00a-e400-4a9b-803b-f84999b6ffca@app.fastmail.com>

"Dan Langille" <dan@langille.org> writes:
>  pkgmessage_textsearchable2 | tsvector                 |           |          | generated always as (to_tsvector('english'::regconfig, translate(pkgmessage, '/'::text, ' '::text))) stored

That is not likely to play well with this:

> freshports.org=> show  default_text_search_config ;
>  default_text_search_config 
> ----------------------------
>  pg_catalog.simple

because "english" and "simple" will stem words differently.

regression=# select websearch_to_tsquery('english', 'example');
 websearch_to_tsquery 
----------------------
 'exampl'
(1 row)

regression=# select websearch_to_tsquery('simple', 'example');
 websearch_to_tsquery 
----------------------
 'example'
(1 row)

If what is in your tsvector is 'exampl', then only the first of
these will match.  So IMO the question is not "why is it failing
on prod?", it's "how the heck did it work on the other machine?".
You won't get nice results if websearch_to_tsquery is using a
different TS configuration than to_tsvector did.

			regards, tom lane





view thread (9+ messages)  latest in thread

Message-ID: <4006202.1671306931@sss.pgh.pa.us>
Permalink:  ../4006202.1671306931@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4006202.1671306931@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, dan@langille.org
  Subject: Re: tsvector not giving expected results on one host
  In-Reply-To: <4006202.1671306931@sss.pgh.pa.us>
  References: <2797dd29-aebb-43a2-9fd7-63bd77a944b2@app.fastmail.com> <9f89f00a-e400-4a9b-803b-f84999b6ffca@app.fastmail.com> <4006202.1671306931@sss.pgh.pa.us>

* 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