postgresql/src
Alexander Korotkov eb086056fe Make websearch_to_tsquery() parse text in quotes as a single token
websearch_to_tsquery() splits text in quotes into tokens and connects them with
phrase operator on its own.  However, that leads to surprising results when the
token contains no words.

For instance, websearch_to_tsquery('"aaa: bbb"') is 'aaa <2> bbb', because
it is equivalent of to_tsquery(E'aaa <-> \':\' <-> bbb').  But
websearch_to_tsquery('"aaa: bbb"') has to be 'aaa <-> bbb' in order to match
to_tsvector('aaa: bbb').

Since 0c4f355c6a, we anyway connect lexemes of complex tokens with phrase
operators.  Thus, let's just websearch_to_tsquery() parse text in quotes as
a single token.  Therefore, websearch_to_tsquery() should process the quoted
text in the same way phraseto_tsquery() does.  This solution is what we exactly
need and also simplifies the code.

This commit is an incompatible change, so we don't backpatch it.

Reported-by: Valentin Gatien-Baron
Discussion: https://postgr.es/m/CA%2B0DEqiZs7gdOd4ikmg%3D0UWG%2BSwWOLxPsk_JW-sx9WNOyrb0KQ%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Tom Lane, Zhihong Yu
2021-05-03 04:18:19 +03:00
..
backend Make websearch_to_tsquery() parse text in quotes as a single token 2021-05-03 04:18:19 +03:00
bin Improve wording of some pg_upgrade failure reports. 2021-04-29 15:40:34 -04:00
common Factor out system call names from error messages 2021-04-23 14:21:37 +02:00
fe_utils psql: Fix line continuation prompts for unbalanced parentheses 2021-04-29 09:04:31 +02:00
include Add heuristic incoming-message-size limits in the server. 2021-04-28 15:50:46 -04:00
interfaces Revert use singular for -1 (commits 9ee7d533da and 5da9868ed9 2021-05-01 10:42:44 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Redesign the caching done by get_cached_rowtype(). 2021-04-13 13:37:07 -04:00
port Fix typos and grammar in comments and docs 2021-04-19 11:32:30 +09:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Make websearch_to_tsquery() parse text in quotes as a single token 2021-05-03 04:18:19 +03:00
timezone Update time zone data files to tzdata release 2021a. 2021-01-24 16:29:47 -05:00
tools Use HTAB for replication slot statistics. 2021-04-27 09:09:11 +05:30
tutorial doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial 2021-04-08 10:51:26 +02:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Update Unicode data to CLDR 39 2021-04-08 08:28:03 +02:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00