| 1 |
CREATE EXTENSION test_parser; |
| 2 |
|
| 3 |
-- make test configuration using parser |
| 4 |
|
| 5 |
CREATE TEXT SEARCH CONFIGURATION testcfg (PARSER = testparser); |
| 6 |
|
| 7 |
ALTER TEXT SEARCH CONFIGURATION testcfg ADD MAPPING FOR word WITH simple; |
| 8 |
|
| 9 |
-- ts_parse |
| 10 |
|
| 11 |
SELECT * FROM ts_parse('testparser', 'That''s simple parser can''t parse urls like http://some.url/here/'); |
| 12 |
|
| 13 |
SELECT to_tsvector('testcfg','That''s my first own parser'); |
| 14 |
|
| 15 |
SELECT to_tsquery('testcfg', 'star'); |
| 16 |
|
| 17 |
SELECT ts_headline('testcfg','Supernovae stars are the brightest phenomena in galaxies', |
| 18 |
to_tsquery('testcfg', 'stars')); |