|
- 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).
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
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;