BUG #16592: websearch_to_tsquery() returns queries that don't result in expected matches

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: bp(at)barryp(dot)org
Subject: BUG #16592: websearch_to_tsquery() returns queries that don't result in expected matches
Date: 2020-08-25 20:07:28
Message-ID: 16592-70b110ff9731c07d@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16592
Logged by: Barry Pederson
Email address: bp(at)barryp(dot)org
PostgreSQL version: 12.4
Operating system: Ubuntu 20.04
Description:

In the regression tests src/test/regress/expected/tsearch.out there's an
example relating to double-quoted searches:

select websearch_to_tsquery('english', '"pg_class pg"');
websearch_to_tsquery
-----------------------------
( 'pg' & 'class' ) <-> 'pg'
(1 row)

However, if you ran a query like that against that exact text 'pg_class pg',
the result is false when I'd expect it should be true

select to_tsvector('pg_class pg') @@ websearch_to_tsquery('"pg_class
pg"');

I'd think websearch_to_tsquery('english', '"pg_class pg"') should ideally
return

'pg' <-> 'class' <-> 'pg'

which does match the original string, e.g:

select to_tsvector('pg_class pg') @@ to_tsquery('pg <-> class <->
pg');

does return true

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message hans.wolters 2020-08-25 20:29:54 password saved in .psql_history
Previous Message Bruce Momjian 2020-08-25 17:35:11 Re: ALTER TABLE ALTER COLUMN SET TYPE crash