@@ -9081,10 +9081,11 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
9081
9081
9082
9082
<table id="textsearch-operators-table">
9083
9083
<title>Text Search Operators</title>
9084
- <tgroup cols="4 ">
9084
+ <tgroup cols="5 ">
9085
9085
<thead>
9086
9086
<row>
9087
9087
<entry>Operator</entry>
9088
+ <entry>Return Type</entry>
9088
9089
<entry>Description</entry>
9089
9090
<entry>Example</entry>
9090
9091
<entry>Result</entry>
@@ -9093,54 +9094,63 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
9093
9094
<tbody>
9094
9095
<row>
9095
9096
<entry> <literal>@@</literal> </entry>
9097
+ <entry><type>boolean</></entry>
9096
9098
<entry><type>tsvector</> matches <type>tsquery</> ?</entry>
9097
9099
<entry><literal>to_tsvector('fat cats ate rats') @@ to_tsquery('cat & rat')</literal></entry>
9098
9100
<entry><literal>t</literal></entry>
9099
9101
</row>
9100
9102
<row>
9101
9103
<entry> <literal>@@@</literal> </entry>
9104
+ <entry><type>boolean</></entry>
9102
9105
<entry>deprecated synonym for <literal>@@</></entry>
9103
9106
<entry><literal>to_tsvector('fat cats ate rats') @@@ to_tsquery('cat & rat')</literal></entry>
9104
9107
<entry><literal>t</literal></entry>
9105
9108
</row>
9106
9109
<row>
9107
9110
<entry> <literal>||</literal> </entry>
9111
+ <entry><type>tsvector</></entry>
9108
9112
<entry>concatenate <type>tsvector</>s</entry>
9109
9113
<entry><literal>'a:1 b:2'::tsvector || 'c:1 d:2 b:3'::tsvector</literal></entry>
9110
9114
<entry><literal>'a':1 'b':2,5 'c':3 'd':4</literal></entry>
9111
9115
</row>
9112
9116
<row>
9113
9117
<entry> <literal>&&</literal> </entry>
9118
+ <entry><type>tsquery</></entry>
9114
9119
<entry>AND <type>tsquery</>s together</entry>
9115
9120
<entry><literal>'fat | rat'::tsquery && 'cat'::tsquery</literal></entry>
9116
9121
<entry><literal>( 'fat' | 'rat' ) & 'cat'</literal></entry>
9117
9122
</row>
9118
9123
<row>
9119
9124
<entry> <literal>||</literal> </entry>
9125
+ <entry><type>tsquery</></entry>
9120
9126
<entry>OR <type>tsquery</>s together</entry>
9121
9127
<entry><literal>'fat | rat'::tsquery || 'cat'::tsquery</literal></entry>
9122
9128
<entry><literal>( 'fat' | 'rat' ) | 'cat'</literal></entry>
9123
9129
</row>
9124
9130
<row>
9125
9131
<entry> <literal>!!</literal> </entry>
9132
+ <entry><type>tsquery</></entry>
9126
9133
<entry>negate a <type>tsquery</></entry>
9127
9134
<entry><literal>!! 'cat'::tsquery</literal></entry>
9128
9135
<entry><literal>!'cat'</literal></entry>
9129
9136
</row>
9130
9137
<row>
9131
9138
<entry> <literal><-></literal> </entry>
9139
+ <entry><type>tsquery</></entry>
9132
9140
<entry><type>tsquery</> followed by <type>tsquery</></entry>
9133
9141
<entry><literal>to_tsquery('fat') <-> to_tsquery('rat')</literal></entry>
9134
9142
<entry><literal>'fat' <-> 'rat'</literal></entry>
9135
9143
</row>
9136
9144
<row>
9137
9145
<entry> <literal>@></literal> </entry>
9146
+ <entry><type>boolean</></entry>
9138
9147
<entry><type>tsquery</> contains another ?</entry>
9139
9148
<entry><literal>'cat'::tsquery @> 'cat & rat'::tsquery</literal></entry>
9140
9149
<entry><literal>f</literal></entry>
9141
9150
</row>
9142
9151
<row>
9143
9152
<entry> <literal><@</literal> </entry>
9153
+ <entry><type>boolean</></entry>
9144
9154
<entry><type>tsquery</> is contained in ?</entry>
9145
9155
<entry><literal>'cat'::tsquery <@ 'cat & rat'::tsquery</literal></entry>
9146
9156
<entry><literal>t</literal></entry>
@@ -9245,7 +9255,8 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
9245
9255
<literal><function>phraseto_tsquery(<optional> <replaceable class="PARAMETER">config</> <type>regconfig</> , </optional> <replaceable class="PARAMETER">query</> <type>text</type>)</function></literal>
9246
9256
</entry>
9247
9257
<entry><type>tsquery</type></entry>
9248
- <entry>produce <type>tsquery</> ignoring punctuation</entry>
9258
+ <entry>produce <type>tsquery</> that searches for a phrase,
9259
+ ignoring punctuation</entry>
9249
9260
<entry><literal>phraseto_tsquery('english', 'The Fat Rats')</literal></entry>
9250
9261
<entry><literal>'fat' <-> 'rat'</literal></entry>
9251
9262
</row>
@@ -9400,7 +9411,8 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
9400
9411
<literal><function>ts_rewrite(<replaceable class="PARAMETER">query</replaceable> <type>tsquery</>, <replaceable class="PARAMETER">target</replaceable> <type>tsquery</>, <replaceable class="PARAMETER">substitute</replaceable> <type>tsquery</>)</function></literal>
9401
9412
</entry>
9402
9413
<entry><type>tsquery</type></entry>
9403
- <entry>replace target with substitute within query</entry>
9414
+ <entry>replace <replaceable>target</> with <replaceable>substitute</>
9415
+ within query</entry>
9404
9416
<entry><literal>ts_rewrite('a & b'::tsquery, 'a'::tsquery, 'foo|bar'::tsquery)</literal></entry>
9405
9417
<entry><literal>'b' & ( 'foo' | 'bar' )</literal></entry>
9406
9418
</row>
@@ -9419,7 +9431,9 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
9419
9431
<literal><function>tsquery_phrase(<replaceable class="PARAMETER">query1</replaceable> <type>tsquery</>, <replaceable class="PARAMETER">query2</replaceable> <type>tsquery</>)</function></literal>
9420
9432
</entry>
9421
9433
<entry><type>tsquery</type></entry>
9422
- <entry>implementation of <literal><-></> (FOLLOWED BY) operator</entry>
9434
+ <entry>make query that searches for <replaceable>query1</> followed
9435
+ by <replaceable>query2</> (same as <literal><-></>
9436
+ operator)</entry>
9423
9437
<entry><literal>tsquery_phrase(to_tsquery('fat'), to_tsquery('cat'))</literal></entry>
9424
9438
<entry><literal>'fat' <-> 'cat'</literal></entry>
9425
9439
</row>
@@ -9428,7 +9442,8 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
9428
9442
<literal><function>tsquery_phrase(<replaceable class="PARAMETER">query1</replaceable> <type>tsquery</>, <replaceable class="PARAMETER">query2</replaceable> <type>tsquery</>, <replaceable class="PARAMETER">distance</replaceable> <type>integer</>)</function></literal>
9429
9443
</entry>
9430
9444
<entry><type>tsquery</type></entry>
9431
- <entry>phrase-concatenate with distance</entry>
9445
+ <entry>make query that searches for <replaceable>query1</> followed by
9446
+ <replaceable>query2</> at maximum distance <replaceable>distance</></entry>
9432
9447
<entry><literal>tsquery_phrase(to_tsquery('fat'), to_tsquery('cat'), 10)</literal></entry>
9433
9448
<entry><literal>'fat' <10> 'cat'</literal></entry>
9434
9449
</row>
0 commit comments