Improve docs of pg_trgm changes
authorTeodor Sigaev
Tue, 22 Mar 2016 14:08:10 +0000 (17:08 +0300)
committerTeodor Sigaev
Tue, 22 Mar 2016 14:08:10 +0000 (17:08 +0300)
Artur Zakirov, per gripe from Jeff Janes

doc/src/sgml/pgtrgm.sgml

index cdce17251f62913b921f8ebac27a75ad809eae27..ef3c15d70536b5761fcabb7be09ef3e8dbe05e98 100644 (file)
       
      
      
-       text %> text
-       boolean
-       
-        Returns true if its first argument has the similar word in
-        the second argument and they have a similarity that is greater than the
-        current word similarity threshold set by
-        pg_trgm.word_similarity_threshold parameter.
-       
-      
+      text <% text
+      boolean
+      
+       Returns true if its first argument has the similar word in
+       the second argument and they have a similarity that is greater than the
+       current word similarity threshold set by
+       pg_trgm.word_similarity_threshold parameter.
+      
+     
+     
+      text %> text
+      boolean
+      
+       Commutator of the <% operator.
+      
+     
      
       text <-> text
       real
       
      
      
-       
-        text <->> text
-       
-       real
-       
-        Returns the distance between the arguments, that is
-        one minus the word_similarity() value.
-       
+      
+       text <<-> text
+      
+      real
+      
+       Returns the distance between the arguments, that is
+       one minus the word_similarity() value.
+      
+     
+     
+      
+       text <->> text
+      
+      real
+      
+       Commutator of the <<-> operator.
+      
      
     
    
      
       
        Sets the current word similarity threshold that is used by
-       the %> operator.  The threshold must be between
-       0 and 1 (default is 0.6).
+       <% and %> operators.  The threshold
+       must be between 0 and 1 (default is 0.6).
       
      
     
@@ -283,7 +299,7 @@ SELECT t, t <-> 'word' AS dist
 
 SELECT t, word_similarity('word', t) AS sml
   FROM test_trgm
-  WHERE t %> 'word'
+  WHERE 'word' <% t
   ORDER BY sml DESC, t;
 
    This will return all values in the text column that have a word
@@ -295,7 +311,7 @@ SELECT t, word_similarity('word', t) AS sml
   
    A variant of the above query is
 
-SELECT t, t <->> 'word' AS dist
+SELECT t, 'word' <<-> t AS dist
   FROM test_trgm
   ORDER BY dist LIMIT 10;