public inbox for [email protected]
help / color / mirror / Atom feedFrom: Daniel Gustafsson <[email protected]>
To: [email protected]
To: [email protected]
Subject: Re: Example not producing shown output
Date: Mon, 25 Nov 2019 15:23:42 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
> On 25 Nov 2019, at 13:05, PG Doc comments form <[email protected]> wrote:
>
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/12/functions-textsearch.html
> Description:
>
> Page: https://www.postgresql.org/docs/12/functions-textsearch.html
>
> Examples should have specified 'english'.
>
> Instead:
> to_tsvector('fat cats ate rats') @@ to_tsquery('cat & rat')
>
> which returns fale on my own blank installation of Postgre (Serbian locale
> Windows OS) instead of true:
> to_tsvector('english', 'fat cats ate rats') @@ to_tsquery('cat & rat')
I agree with this complaint, mainly since other examples on the page do specify
english where required AFAICT, this makes it consistent. The attached diff
adds the english configuration directive to @@ and @@@.
The examples on chapter 12.1 all have the same issue, but adding 'english' to
all of them in order to make them work out of the box everywhere doesn't seem
like an improvement to the docs so those are left as is.
cheers ./daniel
Attachments:
[application/octet-stream] textsearch_english.diff (1.2K, 2-textsearch_english.diff)
download | inline diff:
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 57a1539506..cc29d2ed47 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -9889,14 +9889,14 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
<entry> <literal>@@</literal> </entry>
<entry><type>boolean</type></entry>
<entry><type>tsvector</type> matches <type>tsquery</type> ?</entry>
- <entry><literal>to_tsvector('fat cats ate rats') @@ to_tsquery('cat & rat')</literal></entry>
+ <entry><literal>to_tsvector('english', 'fat cats ate rats') @@ to_tsquery('english', 'cat & rat')</literal></entry>
<entry><literal>t</literal></entry>
</row>
<row>
<entry> <literal>@@@</literal> </entry>
<entry><type>boolean</type></entry>
<entry>deprecated synonym for <literal>@@</literal></entry>
- <entry><literal>to_tsvector('fat cats ate rats') @@@ to_tsquery('cat & rat')</literal></entry>
+ <entry><literal>to_tsvector('english', 'fat cats ate rats') @@@ to_tsquery('english', 'cat & rat')</literal></entry>
<entry><literal>t</literal></entry>
</row>
<row>
view thread (6+ messages) latest in thread
reply
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Example not producing shown output
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox