~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to contrib/test_parser/expected/test_parser.out

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- first, define the parser.  Turn off echoing so that expected file
 
3
-- does not depend on contents of this file.
 
4
--
 
5
SET client_min_messages = warning;
 
6
\set ECHO none
 
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;
 
11
-- ts_parse
 
12
SELECT * FROM ts_parse('testparser', 'That''s simple parser can''t parse urls like http://some.url/here/');
 
13
 tokid |         token         
 
14
-------+-----------------------
 
15
     3 | That's
 
16
    12 |  
 
17
     3 | simple
 
18
    12 |  
 
19
     3 | parser
 
20
    12 |  
 
21
     3 | can't
 
22
    12 |  
 
23
     3 | parse
 
24
    12 |  
 
25
     3 | urls
 
26
    12 |  
 
27
     3 | like
 
28
    12 |  
 
29
     3 | http://some.url/here/
 
30
(15 rows)
 
31
 
 
32
SELECT to_tsvector('testcfg','That''s my first own parser');
 
33
                   to_tsvector                   
 
34
-------------------------------------------------
 
35
 'first':3 'my':2 'own':4 'parser':5 'that''s':1
 
36
(1 row)
 
37
 
 
38
SELECT to_tsquery('testcfg', 'star');
 
39
 to_tsquery 
 
40
------------
 
41
 'star'
 
42
(1 row)
 
43
 
 
44
SELECT ts_headline('testcfg','Supernovae stars are the brightest phenomena in galaxies', 
 
45
       to_tsquery('testcfg', 'stars'));
 
46
                           ts_headline                           
 
47
-----------------------------------------------------------------
 
48
 Supernovae <b>stars</b> are the brightest phenomena in galaxies
 
49
(1 row)
 
50