strange behave of fulltext query when query contains negation of prefix

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: strange behave of fulltext query when query contains negation of prefix
Date: 2012-12-22 17:13:01
Message-ID: CAFj8pRBS1tzAF6QuDBwSG80ncgy5cKGqex0=FcSRvyknhdhxTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello all

I found little bit strange behave of query search when I try to use
negation of prefix

postgres=# select nazev from obce where to_tsvector('simple',nazev) @@
to_tsquery('simple','skalice');
nazev
----------------------
Klášterní Skalice
Stříbrná Skalice
Skalice
Skalice u České Lípy
Skalice
Česká Skalice
Skalice nad Svitavou
Skalice
(8 rows)

Second result is without word "české, česká", and it is correct

postgres=# select nazev from obce where to_tsvector('simple',nazev) @@
to_tsquery('simple','skalice & !(česká | české)');
nazev
----------------------
Klášterní Skalice
Stříbrná Skalice
Skalice
Skalice
Skalice nad Svitavou
Skalice
(6 rows)

but when I try to reduce query with prefix search, then I get unexpected result

postgres=# select nazev from obce where to_tsvector('simple',nazev) @@
to_tsquery('simple','skalice & !čes:*');
nazev
-------
(0 rows)

It is expected??

Regards

Pavel

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-12-22 19:20:56 Re: pgcrypto seeding problem when ssl=on
Previous Message Alexander Korotkov 2012-12-22 16:15:49 Re: WIP: store additional info in GIN index