pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Artur Zakirov <a.zakirov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@postgreSQL.org
Subject: Re: Rethinking our fulltext phrase-search implementation
Date: Wed, 21 Dec 2016 15:34:12 +0300
Message-ID: <773bb687-1388-6c78-af23-5635a41a243d@postgrespro.ru> (raw)
In-Reply-To: <28215.1481999808@sss.pgh.pa.us>
References: <28215.1481999808@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Hello Tom,

On 17.12.2016 21:36, Tom Lane wrote:
>
> 4. The transformations are wrong anyway.  The OR case I showed above is
> all right, but as I argued in <24331.1480199636@sss.pgh.pa.us>, the AND
> case is not:
>
> regression=# select 'a <-> (b & c)'::tsquery;
>           tsquery
> ---------------------------
>  'a' <-> 'b' & 'a' <-> 'c'
> (1 row)
>
> This matches 'a b a c', because 'a <-> b' and 'a <-> c' can each be
> matched at different places in that text; but it seems highly unlikely to
> me that that's what the writer of such a query wanted.  (If she did want
> that, she would write it that way to start with.)  NOT is not very nice
> either:

If I'm not mistaken PostgreSQL 9.6 and master with patch 
"fix-phrase-search.patch" return false for the query:

select 'a b a c' @@ 'a <-> (b & c)'::tsquery;
  ?column?
----------
  f
(1 row)

I agree that such query is confusing. Maybe it is better to return true 
for such queries?
Otherwise it seems that queries like 'a <-> (b & c)' will always return 
false. Then we need maybe some warning message.

-- 
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (5+ messages)  latest in thread

Message-ID: <773bb687-1388-6c78-af23-5635a41a243d@postgrespro.ru>
Permalink:  ../773bb687-1388-6c78-af23-5635a41a243d@postgrespro.ru/
Also on:    postgresql.org/message-id/773bb687-1388-6c78-af23-5635a41a243d@postgrespro.ru

 · 

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-hackers@postgresql.org
  Cc: a.zakirov@postgrespro.ru, tgl@sss.pgh.pa.us
  Subject: Re: Rethinking our fulltext phrase-search implementation
  In-Reply-To: <773bb687-1388-6c78-af23-5635a41a243d@postgrespro.ru>

* 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