Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f6bd0da

Browse files
committed
Improve docs of pg_trgm changes
Artur Zakirov, per gripe from Jeff Janes
1 parent 112a2d0 commit f6bd0da

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

doc/src/sgml/pgtrgm.sgml

+37-21
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,22 @@
153153
</entry>
154154
</row>
155155
<row>
156-
<entry><type>text</> <literal>%&gt;</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>&lt;%</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>%&gt;</literal> <type>text</></entry>
167+
<entry><type>boolean</type></entry>
168+
<entry>
169+
Commutator of the <literal>&lt;%</> operator.
170+
</entry>
171+
</row>
165172
<row>
166173
<entry><type>text</> <literal>&lt;-&gt;</literal> <type>text</></entry>
167174
<entry><type>real</type></entry>
@@ -171,14 +178,23 @@
171178
</entry>
172179
</row>
173180
<row>
174-
<entry>
175-
<type>text</> <literal>&lt;-&gt;&gt;</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>&lt;&lt;-&gt;</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>&lt;-&gt;&gt;</literal> <type>text</>
193+
</entry>
194+
<entry><type>real</type></entry>
195+
<entry>
196+
Commutator of the <literal>&lt;&lt;-&gt;</> operator.
197+
</entry>
182198
</row>
183199
</tbody>
184200
</tgroup>
@@ -215,8 +231,8 @@
215231
<listitem>
216232
<para>
217233
Sets the current word similarity threshold that is used by
218-
the <literal>%&gt;</> operator. The threshold must be between
219-
0 and 1 (default is 0.6).
234+
<literal>&lt;%</> and <literal>%&gt;</> operators. The threshold
235+
must be between 0 and 1 (default is 0.6).
220236
</para>
221237
</listitem>
222238
</varlistentry>
@@ -283,7 +299,7 @@ SELECT t, t &lt;-&gt; '<replaceable>word</>' AS dist
283299
<programlisting>
284300
SELECT t, word_similarity('<replaceable>word</>', t) AS sml
285301
FROM test_trgm
286-
WHERE t %&gt; '<replaceable>word</>'
302+
WHERE '<replaceable>word</>' &lt;% t
287303
ORDER BY sml DESC, t;
288304
</programlisting>
289305
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
295311
<para>
296312
A variant of the above query is
297313
<programlisting>
298-
SELECT t, t &lt;-&gt;&gt; '<replaceable>word</>' AS dist
314+
SELECT t, '<replaceable>word</>' &lt;&lt;-&gt; t AS dist
299315
FROM test_trgm
300316
ORDER BY dist LIMIT 10;
301317
</programlisting>

0 commit comments

Comments
 (0)