Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0VIH-0005z8-P4 for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Mar 2018 16:48:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0VIG-0007Aq-OI for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Mar 2018 16:48:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0VIG-0007Ah-Ec for pgsql-hackers@lists.postgresql.org; Mon, 26 Mar 2018 16:48:24 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0VID-0001yk-94 for pgsql-hackers@lists.postgresql.org; Mon, 26 Mar 2018 16:48:23 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 9086C21C2077; Mon, 26 Mar 2018 19:48:19 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail.postgrespro.ru (cyclops.l.postgrespro.ru [192.168.27.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 6160F21C203F; Mon, 26 Mar 2018 19:48:19 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1522082899; bh=bNftUPSSMXWqz5jdf4smDkq7+0d63FNy8GzoZoE6uZs=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=WGdR68CnGpy7nFttNeErcWwk6BaUPFseRrmMy4XfiTu+mS7RxvwHLRyWKTdW1ms5p MWGJYrFt7aG0GDByNIaaFeCaDRLNJyZWg2YTLOL2sELxdKAKuFodv1rRnJGUmLJvFo sy1o7kAzHFX6uJhRXl+UefMSimW0u7efPfkN+wPU= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 26 Mar 2018 19:48:19 +0300 From: Dmitry Ivanov To: Thomas Munro Cc: Aleksandr Parfenov , David Steele , Aleksander Alekseev , PostgreSQL Hackers Subject: Re: new function for tsquery creartion Organization: Postgres Professional In-Reply-To: References: <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> Message-ID: <6754a224654a4f0339195b83b133d551@postgrespro.ru> X-Sender: d.ivanov@postgrespro.ru User-Agent: Roundcube Webmail/1.2.4 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > 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 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