agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Martin Norbäck Olivers <martin@norpan.org>
Cc: pgsql-sql@lists.postgresql.org
Subject: Re: question about to_tsvector and to_tsquery
Date: Tue, 24 Aug 2021 10:12:51 -0400
Message-ID: <334015.1629814371@sss.pgh.pa.us> (raw)
In-Reply-To: <CALoTC6u=g8Hs4GUq+0ZewHGKMdfcAUqM4wdaxFr2cezB09FvUg@mail.gmail.com>
References: <CALoTC6u=g8Hs4GUq+0ZewHGKMdfcAUqM4wdaxFr2cezB09FvUg@mail.gmail.com>
=?UTF-8?Q?Martin_Norb=C3=A4ck_Olivers?= <martin@norpan.org> 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
view thread (2+ messages)
Message-ID: <334015.1629814371@sss.pgh.pa.us>
Permalink: ../334015.1629814371@sss.pgh.pa.us/
Also on: postgresql.org/message-id/334015.1629814371@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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, martin@norpan.org, pgsql-sql@lists.postgresql.org
Subject: Re: question about to_tsvector and to_tsquery
In-Reply-To: <334015.1629814371@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox