stopping either with the first one to return a lexeme for the token,
or discarding the token if no dictionary returns a lexeme for it.
+
+Function ts_debug allows easy testing of your current configuration.
+You may always test another configuration using set_curcfg function.
+Example:
+
apod=# select * from ts_debug('Tsearch module for PostgreSQL 7.3.3');
+ ts_name | tok_type | description | token | dict_name | tsvector
+---------+----------+-------------+------------+-----------+--------------
+ default | lword | Latin word | Tsearch | {en_stem} | 'tsearch'
+ default | lword | Latin word | module | {en_stem} | 'modul'
+ default | lword | Latin word | for | {en_stem} |
+ default | lword | Latin word | PostgreSQL | {en_stem} | 'postgresql'
+ default | version | VERSION | 7.3.3 | {simple} | '7.3.3'
+
+Here:
+
+
tsname - configuration name
+
tok_type - token type
+
description - human readable name of tok_type
+
token - parser's token
+
dict_name - dictionary used for the token
+
tsvector - final result
+
+
Each parser is defined by a record in the pg_ts_parser table:
which the parser will label each token of that type,
the alias which names the token type,
and a short description descr for the user to read.
-
- Example:
-
-
apod=# select m.ts_name, t.alias as tok_type, t.descr as description, p.token,\
- apod=# m.dict_name, strip(to_tsvector(p.token)) as tsvector\
- apod=# from parse('Tsearch module for PostgreSQL 7.3.3') as\
- apod=# p, token_type() as t, pg_ts_cfgmap as m, pg_ts_cfg as c\
- apod=# where t.tokid=p.tokid and t.alias = m.tok_alias\
- apod=# and m.ts_name=c.ts_name and c.oid=show_curcfg();
- ts_name | tok_type | description | token | dict_name | tsvector
- ---------+----------+-------------+------------+-----------+--------------
- default | lword | Latin word | Tsearch | {en_stem} | 'tsearch'
- default | word | Word | module | {simple} | 'modul'
- default | lword | Latin word | for | {en_stem} |
- default | lword | Latin word | PostgreSQL | {en_stem} | 'postgresql'
- default | version | VERSION | 7.3.3 | {simple} | '7.3.3'
-
- Here:
-
tsname - configuration name
-
tok_type - token type
-
description - human readable name of tok_type
-
token - parser's token
-
dict_name - dictionary will be used for the token
-
tsvector - final result
-
-
CREATE FUNCTION parse(
[ parser, ] document TEXT