From: Dmitry Ivanov <d.ivanov@postgrespro.ru>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Aleksandr Parfenov <a.parfenov@postgrespro.ru>
Cc: David Steele <david@pgmasters.net>
Cc: Aleksander Alekseev <a.alekseev@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: new function for tsquery creartion
Date: Mon, 26 Mar 2018 19:48:19 +0300
Message-ID: <6754a224654a4f0339195b83b133d551@postgrespro.ru> (raw)
In-Reply-To: <CAEepm=3dQmh7NCC_ap-L4yMiVRcZuPXtJUv5_mOnYdoqsnUKvg@mail.gmail.com>
References: <fe931111ff7e9ad79196486ada79e268@postgrespro.ru>
<20180302030605.5ur6ktkb2vyb46pb@alap3.anarazel.de>
<152025433949.1548.16466871234054596674.pgcf@coridan.postgresql.org>
<34280367-0dab-7f73-8d7c-d21c7276814b@pgmasters.net>
<8df9de83119eb295f3424c573d64ff84@postgrespro.ru>
<20180326092405.71820cf2@asp437-24-g082ur>
<a1686708fc7d43d9a2de19c1697ac57e@postgrespro.ru>
<CAEepm=3dQmh7NCC_ap-L4yMiVRcZuPXtJUv5_mOnYdoqsnUKvg@mail.gmail.com>
> Patch 03 (the documentation) needed some proof-reading. I've attached
> a new version of that patch with some small suggested improvements.
Thanks, I'm definitely going to use this.
> Is there anything to_tsquery() can do that websearch_to_tsquery()
> can't?
Currently, no.
> Would it be OK to use user-supplied websearch strings?
> Ie can it produce a syntax error?
I believe that's the most important question. After a private discussion
with Theodor I came to a conclusion that the most beneficial outcome
would be to suppress all syntax errors and give user some result,
cutting all misused operators along the way. This requires some changes,
though.
> Is there any way to write OR as a term (that's a valuable non-stopword
> in French)?
You could quote it like this: websearch_to_tsquery('"or"');
Moreover, it's still possible to use & and |.
> It seems like AROUND(x) should be documented also more generally for
> tsquery, but I see there is some discussion about how that should
> look.
Personally, I like <N, M> operator better. It would instantly deprecate
AROUND(N), which is why I'm going to drop it.
> By the way, not this patch's fault, but I noticed that commit
> f5f1355dc4d did this:
>
> - (errmsg("query contains only
> stopword(s) or doesn't contain lexeme(s), ignored")));
> + (errmsg("text-search query contains
> only stop words or doesn't contain lexemes, ignored")));
>
> But the old test still appears in an example in
> doc/src/sgml/textsearch.sgml.
Will fix this.
--
Dmitry Ivanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: d.ivanov@postgrespro.ru, thomas.munro@enterprisedb.com, a.parfenov@postgrespro.ru, david@pgmasters.net, a.alekseev@postgrespro.ru, pgsql-hackers@lists.postgresql.org
Subject: Re: new function for tsquery creartion
In-Reply-To: <6754a224654a4f0339195b83b133d551@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox