Add documentation about ts_debug
authorTeodor Sigaev
Wed, 6 Aug 2003 09:41:13 +0000 (09:41 +0000)
committerTeodor Sigaev
Wed, 6 Aug 2003 09:41:13 +0000 (09:41 +0000)
contrib/tsearch2/docs/tsearch2-ref.html

index acb673bcab577e57a60ad7020c009fac07eefe36..a6d3107875811c13878bfeb0911ebb6e583fa246 100644 (file)
@@ -216,7 +216,33 @@ These dictionaries are tried in order,
 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.
 
-

Parsers

+

Testing

+
+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
  • +
    +
    +

    Parsers

     
     Each parser is defined by a record in the pg_ts_parser table:
     
    @@ -261,33 +287,6 @@ the current parser is used when this argument is omitted.
      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