Re: websearch_to_tsquery() returns queries that don't match to_tsvector()

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: websearch_to_tsquery() returns queries that don't match to_tsvector()
Дата
Msg-id CAPpHfdsKy5TzOTq5aV8tn+KQEd_C5mF0Sd_BrZ0e3+wGY5tLFw@mail.gmail.com
обсуждение исходный текст
Ответы Re: websearch_to_tsquery() returns queries that don't match to_tsvector()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi!

On Mon, Apr 19, 2021 at 9:57 AM Valentin Gatien-Baron
<valentin.gatienbaron@gmail.com> wrote:
> Looking at the tsvector and tsquery, we can see that the problem is
> that the ":" counts as one position for the ts_query but not the
> ts_vector:
>
> select to_tsvector('english', 'aaa: bbb'), websearch_to_tsquery('english', '"aaa: bbb"');
>    to_tsvector   | websearch_to_tsquery
> -----------------+----------------------
>  'aaa':1 'bbb':2 | 'aaa' <2> 'bbb'
> (1 row)

It seems there is another bug with phrase search and query parsing.
It seems to me that since 0c4f355c6a websearch_to_tsquery() should
just parse text in quotes as a single token.  Besides fixing this bug,
it simplifies the code.

Trying to fix this bug before 0c4f355c6a doesn't seem to worth the efforts.

I propose to push the attached patch to v14.  Objections?

------
Regards,
Alexander Korotkov

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Regex performance regression induced by match-all code
Следующее
От: Tom Lane
Дата:
Сообщение: Re: websearch_to_tsquery() returns queries that don't match to_tsvector()