diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 86cb2379fcc..b0afaebf728 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -11381,11 +11381,12 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
query text )
tsquery
- Converts text to a tsquery, normalizing words according to
- the specified or default configuration. Quoted word sequences are
- converted to phrase tests, and the word or
is
- understood as producing an OR operator. This approximates the
- behavior of some common web search tools.
+ Converts text to a tsquery, normalizing words according
+ to the specified or default configuration. Quoted word sequences are
+ converted to phrase tests. The word or
is understood
+ as producing an OR operator, and a dash produces a NOT operator;
+ other punctuation is ignored.
+ This approximates the behavior of some common web search tools.
websearch_to_tsquery('english', '"fat rat" or cat dog')
'fat' <-> 'rat' | 'cat' & 'dog'
diff --git a/doc/src/sgml/textsearch.sgml b/doc/src/sgml/textsearch.sgml
index ce2b4c664f9..187ff22f3ea 100644
--- a/doc/src/sgml/textsearch.sgml
+++ b/doc/src/sgml/textsearch.sgml
@@ -913,7 +913,7 @@ SELECT plainto_tsquery('english', 'The Fat & Rats:C');
'fat' & 'rat' & 'c'
- Here, all the input punctuation was discarded as being space symbols.
+ Here, all the input punctuation was discarded.
@@ -969,16 +969,16 @@ websearch_to_tsquery( configplainto_tsquery
and phraseto_tsquery, it also recognizes certain
- operators. Moreover, this function should never raise syntax errors,
+ operators. Moreover, this function will never raise syntax errors,
which makes it possible to use raw user-supplied input for search.
The following syntax is supported:
+
unquoted text: text not inside quote marks will be
converted to terms separated by & operators, as
- if processed by
- plainto_tsquery.
+ if processed by plainto_tsquery.
@@ -990,18 +990,26 @@ websearch_to_tsquery( config
- OR: logical or will be converted to
+ OR: the word or
will be converted to
the | operator.
- -: the logical not operator, converted to the
+ -: a dash will be converted to
the ! operator.
+
+ Other punctuation is ignored. So
+ like plainto_tsquery
+ and phraseto_tsquery,
+ the websearch_to_tsquery function will not
+ recognize tsquery operators, weight labels, or prefix-match
+ labels in its input.
+
Examples: