From: Teodor Sigaev Date: Tue, 22 Mar 2016 14:08:10 +0000 (+0300) Subject: Improve docs of pg_trgm changes X-Git-Tag: REL9_6_BETA1~414 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6bd0da63bf40bc324eec6fd47f3d3d301f44dab;p=thirdparty%2Fpostgresql.git Improve docs of pg_trgm changes Artur Zakirov, per gripe from Jeff Janes --- diff --git a/doc/src/sgml/pgtrgm.sgml b/doc/src/sgml/pgtrgm.sgml index cdce17251f6..ef3c15d7053 100644 --- a/doc/src/sgml/pgtrgm.sgml +++ b/doc/src/sgml/pgtrgm.sgml @@ -153,15 +153,22 @@ - 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 @@ -171,14 +178,23 @@ - - 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. + @@ -215,8 +231,8 @@ 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;