2
-- first, define the parser. Turn off echoing so that expected file
3
-- does not depend on contents of this file.
5
SET client_min_messages = warning;
7
RESET client_min_messages;
8
-- make test configuration using parser
9
CREATE TEXT SEARCH CONFIGURATION testcfg (PARSER = testparser);
10
ALTER TEXT SEARCH CONFIGURATION testcfg ADD MAPPING FOR word WITH simple;
12
SELECT * FROM ts_parse('testparser', 'That''s simple parser can''t parse urls like http://some.url/here/');
14
-------+-----------------------
29
3 | http://some.url/here/
32
SELECT to_tsvector('testcfg','That''s my first own parser');
34
-------------------------------------------------
35
'first':3 'my':2 'own':4 'parser':5 'that''s':1
38
SELECT to_tsquery('testcfg', 'star');
44
SELECT ts_headline('testcfg','Supernovae stars are the brightest phenomena in galaxies',
45
to_tsquery('testcfg', 'stars'));
47
-----------------------------------------------------------------
48
Supernovae <b>stars</b> are the brightest phenomena in galaxies