153
153
</entry>
154
154
</row>
155
155
<row>
156
- <entry><type>text</> <literal>%></literal> <type>text</></entry>
157
- <entry><type>boolean</type></entry>
158
- <entry>
159
- Returns <literal>true</> if its first argument has the similar word in
160
- the second argument and they have a similarity that is greater than the
161
- current word similarity threshold set by
162
- <varname>pg_trgm.word_similarity_threshold</> parameter.
163
- </entry>
164
- </row>
156
+ <entry><type>text</> <literal><%</literal> <type>text</></entry>
157
+ <entry><type>boolean</type></entry>
158
+ <entry>
159
+ Returns <literal>true</> if its first argument has the similar word in
160
+ the second argument and they have a similarity that is greater than the
161
+ current word similarity threshold set by
162
+ <varname>pg_trgm.word_similarity_threshold</> parameter.
163
+ </entry>
164
+ </row>
165
+ <row>
166
+ <entry><type>text</> <literal>%></literal> <type>text</></entry>
167
+ <entry><type>boolean</type></entry>
168
+ <entry>
169
+ Commutator of the <literal><%</> operator.
170
+ </entry>
171
+ </row>
165
172
<row>
166
173
<entry><type>text</> <literal><-></literal> <type>text</></entry>
167
174
<entry><type>real</type></entry>
171
178
</entry>
172
179
</row>
173
180
<row>
174
- <entry>
175
- <type>text</> <literal><->></literal> <type>text</>
176
- </entry>
177
- <entry><type>real</type></entry>
178
- <entry>
179
- Returns the <quote>distance</> between the arguments, that is
180
- one minus the <function>word_similarity()</> value.
181
- </entry>
181
+ <entry>
182
+ <type>text</> <literal><<-></literal> <type>text</>
183
+ </entry>
184
+ <entry><type>real</type></entry>
185
+ <entry>
186
+ Returns the <quote>distance</> between the arguments, that is
187
+ one minus the <function>word_similarity()</> value.
188
+ </entry>
189
+ </row>
190
+ <row>
191
+ <entry>
192
+ <type>text</> <literal><->></literal> <type>text</>
193
+ </entry>
194
+ <entry><type>real</type></entry>
195
+ <entry>
196
+ Commutator of the <literal><<-></> operator.
197
+ </entry>
182
198
</row>
183
199
</tbody>
184
200
</tgroup>
215
231
<listitem>
216
232
<para>
217
233
Sets the current word similarity threshold that is used by
218
- the <literal>%></> operator . The threshold must be between
219
- 0 and 1 (default is 0.6).
234
+ <literal><%</> and <literal>%></> operators . The threshold
235
+ must be between 0 and 1 (default is 0.6).
220
236
</para>
221
237
</listitem>
222
238
</varlistentry>
@@ -283,7 +299,7 @@ SELECT t, t <-> '<replaceable>word</>' AS dist
283
299
<programlisting>
284
300
SELECT t, word_similarity('<replaceable>word</>', t) AS sml
285
301
FROM test_trgm
286
- WHERE t %> '<replaceable>word</>'
302
+ WHERE '<replaceable>word</>' <% t
287
303
ORDER BY sml DESC, t;
288
304
</programlisting>
289
305
This will return all values in the text column that have a word
@@ -295,7 +311,7 @@ SELECT t, word_similarity('<replaceable>word</>', t) AS sml
295
311
<para>
296
312
A variant of the above query is
297
313
<programlisting>
298
- SELECT t, t <-> > '<replaceable>word</>' AS dist
314
+ SELECT t, '<replaceable>word</>' <<- > t AS dist
299
315
FROM test_trgm
300
316
ORDER BY dist LIMIT 10;
301
317
</programlisting>
0 commit comments