diff options
Diffstat (limited to 'doc/src/sgml/func.sgml')
-rw-r--r-- | doc/src/sgml/func.sgml | 91 |
1 files changed, 89 insertions, 2 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 4b5ee8135f0..000489d961b 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -9211,16 +9211,29 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <indexterm> <primary>setweight</primary> </indexterm> - <literal><function>setweight(<type>tsvector</>, <type>"char"</>)</function></literal> + <literal><function>setweight(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weight</replaceable> <type>"char"</>)</function></literal> </entry> <entry><type>tsvector</type></entry> - <entry>assign weight to each element of <type>tsvector</></entry> + <entry>assign <replaceable class="PARAMETER">weight</replaceable> to each element of <replaceable class="PARAMETER">vector</replaceable></entry> <entry><literal>setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')</literal></entry> <entry><literal>'cat':3A 'fat':2A,4A 'rat':5A</literal></entry> </row> <row> <entry> <indexterm> + <primary>setweight</primary> + <secondary>setweight by filter</secondary> + </indexterm> + <literal><function>setweight(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weight</replaceable> <type>"char"</>, <replaceable class="PARAMETER">lexemes</replaceable> <type>"text"[]</>)</function></literal> + </entry> + <entry><type>tsvector</type></entry> + <entry>assign <replaceable class="PARAMETER">weight</replaceable> to elements of <replaceable class="PARAMETER">vector</replaceable> that are listed in <replaceable class="PARAMETER">lexemes</replaceable> array</entry> + <entry><literal>setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A', '{cat,rat}')</literal></entry> + <entry><literal>'cat':3A 'fat':2,4 'rat':5A</literal></entry> + </row> + <row> + <entry> + <indexterm> <primary>strip</primary> </indexterm> <literal><function>strip(<type>tsvector</>)</function></literal> @@ -9233,6 +9246,80 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <row> <entry> <indexterm> + <primary>delete</primary> + <secondary>delete lemexeme</secondary> + </indexterm> + <literal><function>delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexeme</replaceable> <type>text</>)</function></literal> + </entry> + <entry><type>tsvector</type></entry> + <entry>remove given <replaceable class="PARAMETER">lexeme</replaceable> from <replaceable class="PARAMETER">vector</replaceable></entry> + <entry><literal>delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat')</literal></entry> + <entry><literal>'cat':3 'rat':5A</literal></entry> + </row> + <row> + <entry> + <indexterm> + <primary>delete</primary> + <secondary>delete lemexemes array</secondary> + </indexterm> + <literal><function>delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexemes</replaceable> <type>text[]</>)</function></literal> + </entry> + <entry><type>tsvector</type></entry> + <entry>remove any occurrence of lexemes in <replaceable class="PARAMETER">lexemes</replaceable> array from <replaceable class="PARAMETER">vector</replaceable></entry> + <entry><literal>delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat'])</literal></entry> + <entry><literal>'cat':3</literal></entry> + </row> + <row> + <entry> + <indexterm> + <primary>unnest</primary> + </indexterm> + <literal><function>unnest(<type>tsvector</>, OUT <replaceable class="PARAMETER">lexeme</> <type>text</>, OUT <replaceable class="PARAMETER">positions</> <type>smallint[]</>, OUT <replaceable class="PARAMETER">weights</> <type>text</>)</function></literal> + </entry> + <entry><type>setof record</type></entry> + <entry>expand a tsvector to a set of rows</entry> + <entry><literal>unnest('fat:2,4 cat:3 rat:5A'::tsvector)</literal></entry> + <entry><literal>(cat,{3},{D}) ...</literal></entry> + </row> + <row> + <entry> + <indexterm> + <primary>tsvector_to_array</primary> + </indexterm> + <literal><function>tsvector_to_array(<type>tsvector</>)</function></literal> + </entry> + <entry><type>text[]</type></entry> + <entry>convert <type>tsvector</> to array of lexemes</entry> + <entry><literal>tsvector_to_array('fat:2,4 cat:3 rat:5A'::tsvector)</literal></entry> + <entry><literal>{cat,fat,rat}</literal></entry> + </row> + <row> + <entry> + <indexterm> + <primary>array_to_tsvector</primary> + </indexterm> + <literal><function>array_to_tsvector(<type>text[]</>)</function></literal> + </entry> + <entry><type>tsvector</type></entry> + <entry>convert array of lexemes to <type>tsvector</type></entry> + <entry><literal>array_to_tsvector('{fat,cat,rat}'::text[])</literal></entry> + <entry><literal>'fat' 'cat' 'rat'</literal></entry> + </row> + <row> + <entry> + <indexterm> + <primary>filter</primary> + </indexterm> + <literal><function>filter(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weights</replaceable> <type>"char"[]</>)</function></literal> + </entry> + <entry><type>tsvector</type></entry> + <entry>Select only elements with given <replaceable class="PARAMETER">weights</replaceable> from <replaceable class="PARAMETER">vector</replaceable></entry> + <entry><literal>filter('fat:2,4 cat:3b rat:5A'::tsvector, '{a,b}')</literal></entry> + <entry><literal>'cat':3B 'rat':5A</literal></entry> + </row> + <row> + <entry> + <indexterm> <primary>to_tsquery</primary> </indexterm> <literal><function>to_tsquery(<optional> <replaceable class="PARAMETER">config</> <type>regconfig</> , </optional> <replaceable class="PARAMETER">query</> <type>text</type>)</function></literal> |