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 1mIXAg-0005ky-O4 for pgsql-sql@arkaria.postgresql.org; Tue, 24 Aug 2021 14:12:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mIXAf-0002l5-NC for pgsql-sql@arkaria.postgresql.org; Tue, 24 Aug 2021 14:12:57 +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 1mIXAf-0002kx-GE for pgsql-sql@lists.postgresql.org; Tue, 24 Aug 2021 14:12:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIXAa-0000b0-KI for pgsql-sql@lists.postgresql.org; Tue, 24 Aug 2021 14:12:56 +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 17OECppd334016; Tue, 24 Aug 2021 10:12:51 -0400 From: Tom Lane To: =?UTF-8?Q?Martin_Norb=C3=A4ck_Olivers?= cc: pgsql-sql@lists.postgresql.org Subject: Re: question about to_tsvector and to_tsquery In-reply-to: References: Comments: In-reply-to =?UTF-8?Q?Martin_Norb=C3=A4ck_Olivers?= message dated "Tue, 24 Aug 2021 14:01:23 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <334014.1629814371.1@sss.pgh.pa.us> Date: Tue, 24 Aug 2021 10:12:51 -0400 Message-ID: <334015.1629814371@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?UTF-8?Q?Martin_Norb=C3=A4ck_Olivers?= writes: > Is there any more information on exactly how to_tsquery and to_tsvector are > supposed to work? > select to_tsvector('simple', '1.b') gives '1':1 'b':2 > but > select to_tsvector('simple', '1.bb') gives '1.bb':1 ts_debug gives a little bit of insight: postgres=# select * from ts_debug('simple', '1.b'); alias | description | token | dictionaries | dictionary | lexemes -----------+------------------+-------+--------------+------------+--------- uint | Unsigned integer | 1 | {simple} | simple | {1} blank | Space symbols | . | {} | | asciiword | Word, all ASCII | b | {simple} | simple | {b} (3 rows) postgres=# select * from ts_debug('simple', '1.bb'); alias | description | token | dictionaries | dictionary | lexemes -------+-------------+-------+--------------+------------+--------- host | Host | 1.bb | {simple} | simple | {1.bb} (1 row) I don't know the exact rules that cause classification of something as a "host" token. It does seem a little weird that length matters. regards, tom lane