Previous   Next 

Function token_type

Returns all tokens that a parser supports.

token_type([ parser INT4 | TEXT ]) RETURNS SETOF TOKENTYPE

  • If specified, 'parser' is an object id (oid) or a text name of a parser listed in table pg_ts_parser.
  • Tsearch currently only ships with 1 parser, 'default'.
SELECT * FROM token_type('default');

 tokid |    alias     |               descr
-------+--------------+-----------------------------------
     1 | lword        | Latin word
     2 | nlword       | Non-latin word
     3 | word         | Word
     4 | email        | Email
     5 | url          | URL
     6 | host         | Host
     7 | sfloat       | Scientific notation
     8 | version      | VERSION
     9 | part_hword   | Part of hyphenated word
    10 | nlpart_hword | Non-latin part of hyphenated word
    11 | lpart_hword  | Latin part of hyphenated word
    12 | blank        | Space symbols
    13 | tag          | HTML Tag
    14 | http         | HTTP head
    15 | hword        | Hyphenated word
    16 | lhword       | Latin hyphenated word
    17 | nlhword      | Non-latin hyphenated word
    18 | uri          | URI
    19 | file         | File or path name
    20 | float        | Decimal notation
    21 | int          | Signed integer
    22 | uint         | Unsigned integer
    23 | entity       | HTML Entity
(23 rows)