Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHuLp-00BV2K-5H for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Jun 2024 23:59:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sHuLm-009pLh-EO for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Jun 2024 23:59:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHuLm-009pIN-50 for pgsql-bugs@lists.postgresql.org; Thu, 13 Jun 2024 23:59:27 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHuLk-001Y1l-Ia for pgsql-bugs@lists.postgresql.org; Thu, 13 Jun 2024 23:59:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 45DNxMXk2184371; Thu, 13 Jun 2024 19:59:22 -0400 From: Tom Lane To: esemmano@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18479: websearch_to_tsquery inconsistent behavior for german when using parentheses In-reply-to: <2130969.1718316260@sss.pgh.pa.us> References: <18479-d9b46e2fc242c33e@postgresql.org> <2130969.1718316260@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 13 Jun 2024 18:04:20 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2184369.1718323162.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 13 Jun 2024 19:59:22 -0400 Message-ID: <2184370.1718323162@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk [ couldn't let go of this ... ] I wrote: > It's fairly confusing that this code manages to ignore not-ISOPERATOR > punctuation. It seems like that gets eaten by gettoken_tsvector() > and then later we decide there's not really a word there. Yeah, further investigation shows that such cases effectively act like stopwords: they are passed back to makepol() as VAL strings, but then lexize processing rejects them as not words. > I'm also confused how come the same thing doesn't happen in the > english tsconfig. Not sure it's worth poking at more, though. D'oh: "or" is a stopword in the english config. The english case is still wrong of course, just differently: regression=3D# select websearch_to_tsquery('english', 'foo or (baz bar) or= (ding dong)'); websearch_to_tsquery = ----------------------------------------- 'foo' | 'baz' & 'bar' & 'ding' & 'dong' (1 row) regards, tom lane