diff options
author | Tom Lane | 2016-05-05 23:43:32 +0000 |
---|---|---|
committer | Tom Lane | 2016-05-05 23:43:32 +0000 |
commit | 0b9a23443283f9ffb17a39c25f74adefdb72cae1 (patch) | |
tree | 56052b02be0943f6d658469a3a5dbc8283e618f6 /doc/src | |
parent | 2f38b986fa8ff048c7226f1ca212e12084c715cf (diff) |
Rename tsvector delete() to ts_delete(), and filter() to ts_filter().
The similarity of the original names to SQL keywords seems like a bad
idea. Rename them before we're stuck with 'em forever.
In passing, minor code and docs cleanup.
Discussion: <4875.1462210058@sss.pgh.pa.us>
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 132 | ||||
-rw-r--r-- | doc/src/sgml/textsearch.sgml | 3 |
2 files changed, 67 insertions, 68 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index e1c3b48bf40..c8dd838d253 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -9180,6 +9180,18 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <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>get_current_ts_config</primary> </indexterm> <literal><function>get_current_ts_config()</function></literal> @@ -9267,10 +9279,10 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <primary>setweight</primary> <secondary>setweight for specific lexeme(s)</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> + <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>assign <replaceable class="PARAMETER">weight</replaceable> to elements of <replaceable class="PARAMETER">vector</replaceable> that are listed in <replaceable class="PARAMETER">lexemes</replaceable></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> @@ -9289,103 +9301,64 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <row> <entry> <indexterm> - <primary>delete</primary> - <secondary>delete lexeme(s) from tsvector</secondary> + <primary>to_tsquery</primary> </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> - <!-- previous indexterm entry covers this too --> - <literal><function>delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexemes</replaceable> <type>text[]</>)</function></literal> + <literal><function>to_tsquery(<optional> <replaceable class="PARAMETER">config</> <type>regconfig</> , </optional> <replaceable class="PARAMETER">query</> <type>text</type>)</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> + <entry><type>tsquery</type></entry> + <entry>normalize words and convert to <type>tsquery</></entry> + <entry><literal>to_tsquery('english', 'The & Fat & Rats')</literal></entry> + <entry><literal>'fat' & 'rat'</literal></entry> </row> <row> <entry> <indexterm> - <primary>unnest</primary> - <secondary>for tsvector</secondary> + <primary>to_tsvector</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> + <literal><function>to_tsvector(<optional> <replaceable class="PARAMETER">config</> <type>regconfig</> , </optional> <replaceable class="PARAMETER">document</> <type>text</type>)</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> + <entry><type>tsvector</type></entry> + <entry>reduce document text to <type>tsvector</></entry> + <entry><literal>to_tsvector('english', 'The Fat Rats')</literal></entry> + <entry><literal>'fat':2 'rat':3</literal></entry> </row> <row> <entry> <indexterm> - <primary>tsvector_to_array</primary> + <primary>ts_delete</primary> </indexterm> - <literal><function>tsvector_to_array(<type>tsvector</>)</function></literal> + <literal><function>ts_delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexeme</replaceable> <type>text</>)</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> + <entry><type>tsvector</type></entry> + <entry>remove given <replaceable class="PARAMETER">lexeme</replaceable> from <replaceable class="PARAMETER">vector</replaceable></entry> + <entry><literal>ts_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>array_to_tsvector</primary> - </indexterm> - <literal><function>array_to_tsvector(<type>text[]</>)</function></literal> + <!-- previous indexterm entry covers this too --> + <literal><function>ts_delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexemes</replaceable> <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> + <entry>remove any occurrence of lexemes in <replaceable class="PARAMETER">lexemes</replaceable> from <replaceable class="PARAMETER">vector</replaceable></entry> + <entry><literal>ts_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>filter</primary> - <secondary>for tsvector</secondary> + <primary>ts_filter</primary> </indexterm> - <literal><function>filter(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weights</replaceable> <type>"char"[]</>)</function></literal> + <literal><function>ts_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>ts_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> - </entry> - <entry><type>tsquery</type></entry> - <entry>normalize words and convert to <type>tsquery</></entry> - <entry><literal>to_tsquery('english', 'The & Fat & Rats')</literal></entry> - <entry><literal>'fat' & 'rat'</literal></entry> - </row> - <row> - <entry> - <indexterm> - <primary>to_tsvector</primary> - </indexterm> - <literal><function>to_tsvector(<optional> <replaceable class="PARAMETER">config</> <type>regconfig</> , </optional> <replaceable class="PARAMETER">document</> <type>text</type>)</function></literal> - </entry> - <entry><type>tsvector</type></entry> - <entry>reduce document text to <type>tsvector</></entry> - <entry><literal>to_tsvector('english', 'The Fat Rats')</literal></entry> - <entry><literal>'fat':2 'rat':3</literal></entry> - </row> - <row> - <entry> - <indexterm> <primary>ts_headline</primary> </indexterm> <literal><function>ts_headline(<optional> <replaceable class="PARAMETER">config</replaceable> <type>regconfig</>, </optional> <replaceable class="PARAMETER">document</replaceable> <type>text</>, <replaceable class="PARAMETER">query</replaceable> <type>tsquery</> <optional>, <replaceable class="PARAMETER">options</replaceable> <type>text</> </optional>)</function></literal> @@ -9462,6 +9435,18 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <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>tsvector_update_trigger</primary> </indexterm> <literal><function>tsvector_update_trigger()</function></literal> @@ -9483,6 +9468,19 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><literal>CREATE TRIGGER ... tsvector_update_trigger_column(tsvcol, configcol, title, body)</literal></entry> <entry><literal></literal></entry> </row> + <row> + <entry> + <indexterm> + <primary>unnest</primary> + <secondary>for tsvector</secondary> + </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> </tbody> </tgroup> </table> diff --git a/doc/src/sgml/textsearch.sgml b/doc/src/sgml/textsearch.sgml index 78eaf748676..bee1fbf1749 100644 --- a/doc/src/sgml/textsearch.sgml +++ b/doc/src/sgml/textsearch.sgml @@ -1412,7 +1412,8 @@ FROM (SELECT id, body, q, ts_rank_cd(ti, q) AS rank </variablelist> <para> - Full list of <type>tsvector</>-related functions available in <xref linkend="textsearch-functions-table">. + A full list of <type>tsvector</>-related functions is available + in <xref linkend="textsearch-functions-table">. </para> </sect2> |