Re: Phrase search vs. multi-lexeme tokens

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Phrase search vs. multi-lexeme tokens
Date: 2021-01-20 17:27:01
Message-ID: CAPpHfdsK9C-X-ag7ktK=j5dcT0Qo2WWY_gLWgPShe2yQyDBm+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 7, 2021 at 6:36 AM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
>
> > I read your patch over quickly and it seems like a reasonable
> > approach (but sadly underdocumented). Can we extend the idea
> > to fix the to_tsquery case?
>
> Sure, I'll provide a revised patch.

The next version of the patch is attached. Now, it just makes
to_tsquery() and websearch_to_tsquery() use phrase operator to connect
multiple lexemes of the same tsquery token. I leave plainto_tsquery()
aside because it considers the whole argument as a single token.
Changing it would make it an equivalent of phraseto_tsquery().

------
Regards,
Alexander Korotkov

Attachment Content-Type Size
tsquery_phrase_fix.path application/octet-stream 6.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-01-20 17:34:30 Re: strange error reporting
Previous Message Tom Lane 2021-01-20 17:19:29 Re: strange error reporting