Re: Phrase search distance syntax

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Phrase search distance syntax
Date: 2016-09-23 14:07:26
Message-ID: 57E5371E.7030601@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Sorry to be asking another phrase search syntax question, and so close
> to final release, but ...
Really close...
>
> Why does the phrase distance operator assume <1> means adjacent words,
> and not <0>. (FYI, <-> is the same as <1>.)
Because
1 it is a result of subtruction of word's positions
2 <0> could be used as special case like a word with two infinitives:
# create text search dictionary xx (template = 'ispell',
DictFile='ispell_sample', AffFile='ispell_sample');
# alter text search configuration english ALTER MAPPING FOR asciiword WITH xx,
english_stem;

# select to_tsvector('english', 'bookings');
to_tsvector
----------------------
'book':1 'booking':1

# select to_tsvector('english', 'bookings') @@ 'book <0> booking';
?column?
----------
t
(1 row)

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2016-09-23 14:09:34 Re: Phrase search distance syntax
Previous Message Michael Paquier 2016-09-23 13:46:10 Re: [PATCH] Remove redundant if clause in standbydesc.c