Doc: improve documentation of websearch_to_tqsuery().
authorTom Lane
Sun, 26 Apr 2020 15:45:54 +0000 (11:45 -0400)
committerTom Lane
Sun, 26 Apr 2020 15:45:54 +0000 (11:45 -0400)
It wasn't totally clear about punctuation other than what's
specified being ignored.

Pavel Borisov and Tom Lane

Discussion: https://postgr.es/m/CALT9ZEFsBdsogVjG40Z4KfM1Um=wj1FE9hJ00GK3oVfzz0sFNg@mail.gmail.com

doc/src/sgml/func.sgml
doc/src/sgml/textsearch.sgml

index 86cb2379fcce54a4c1cfa445f0b5de0f3df7985f..b0afaebf728939a9bf5891bbb61e5dcd3d7e4c5f 100644 (file)
@@ -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'
index ce2b4c664f9423ec3f4fac7fb811db66887bc4aa..187ff22f3eaf9574000fa275257bf2886fcc70ff 100644 (file)
@@ -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( config
     syntax in which simple unformatted text is a valid query.
     Unlike plainto_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
      
      
       
-       ORlogical or will be converted to
+       ORthe 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: