The granite features of this cliff
(1 row)
+--check debug
+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'
+(5 rows)
+
Upon a woman s face. E. J. Pratt (1882 1964)
', to_tsquery('sea'));
+--check debug
+select * from ts_debug('Tsearch module for PostgreSQL 7.3.3');
language 'C'
with (isstrict);
+--debug function
+create type tsdebug as (
+ ts_name text,
+ tok_type text,
+ description text,
+ token text,
+ dict_name text[],
+ "tsvector" tsvector
+);
+
+create function _get_parser_from_curcfg()
+returns text as
+' select prs_name from pg_ts_cfg where oid = show_curcfg() '
+language 'SQL' with(isstrict,iscachable);
+
+create function ts_debug(text)
+returns setof tsdebug as '
+select
+ m.ts_name,
+ t.alias as tok_type,
+ t.descr as description,
+ p.token,
+ m.dict_name,
+ strip(to_tsvector(p.token)) as tsvector
+from
+ parse( _get_parser_from_curcfg(), $1 ) as p,
+ token_type() as t,
+ pg_ts_cfgmap as m,
+ pg_ts_cfg as c
+where
+ t.tokid=p.tokid and
+ t.alias = m.tok_alias and
+ m.ts_name=c.ts_name and
+ c.oid=show_curcfg()
+' language 'SQL' with(isstrict);
+
--example of ISpell dictionary
--update pg_ts_dict set dict_initoption='DictFile="/usr/local/share/ispell/russian.dict" ,AffFile ="/usr/local/share/ispell/russian.aff", StopFile="/usr/local/share/ispell/russian.stop"' where dict_id=4;
DROP TYPE gtsvector CASCADE;
DROP TYPE tsstat CASCADE;
DROP TYPE statinfo CASCADE;
+DROP TYPE tsdebug CASCADE;
+
DROP FUNCTION lexize(oid, text) ;
DROP FUNCTION lexize(text, text);
DROP FUNCTION gtsvector_union(bytea, internal);
DROP FUNCTION reset_tsearch();
DROP FUNCTION tsearch2() CASCADE;
+DROP FUNCTION _get_parser_from_curcfg();
END;