File: rum_weight.out

package info (click to toggle)
postgresql-rum 1.3.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,956 kB
  • sloc: ansic: 29,184; sql: 6,614; perl: 546; python: 97; makefile: 68; sh: 64
file content (136 lines) | stat: -rw-r--r-- 3,379 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
CREATE TABLE testweight_rum( t text, a tsvector, r text );
CREATE FUNCTION fill_weight_trigger() RETURNS trigger AS $$
begin
  new.a :=
     setweight(to_tsvector('pg_catalog.english', coalesce(new.r,'')), 'A') ||
     setweight(to_tsvector('pg_catalog.english', coalesce(new.t,'')), 'D');
  return new;
end
$$ LANGUAGE plpgsql;
CREATE TRIGGER tsvectorweightupdate
BEFORE INSERT OR UPDATE ON testweight_rum
FOR EACH ROW EXECUTE PROCEDURE fill_weight_trigger();
CREATE INDEX rumidx_weight ON testweight_rum USING rum (a rum_tsvector_ops);
\copy testweight_rum(t,r) from 'data/rum_weight.data' DELIMITER '|' ;
SET enable_seqscan=off;
SET enable_indexscan=off;
SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever:A|wrote');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'have:A&wish:DAC');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'have:A&wish:DAC');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'among:ABC');
 count 
-------
     0
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'structure:D&ancient:BCD');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', '(complimentary:DC|sight)&(sending:ABC|heart)');
 count 
-------
     2
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', '!gave:D & way');
 count 
-------
     3
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', '(go<->go:a)&(think:d<->go)');
 count 
-------
     0
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', '(go<->go:a)&(think:d<2>go)');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'go & (!reach:a | way<->reach)');
 count 
-------
     2
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'go & (!reach:a & way<->reach)');
 count 
-------
     0
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'reach:d & go & !way:a');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'show:d & seem & !town:a');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', '!way:a');
 count 
-------
    52
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'go & !way:a');
 count 
-------
     2
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'reach:d & !way:a');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'reach:d & go');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'think<->go:d | go<->see');
 count 
-------
     1
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'reach:d<->think');
 count 
-------
     0
(1 row)

SELECT count(*) FROM testweight_rum WHERE a @@ to_tsquery('pg_catalog.english', 'reach<->think');
 count 
-------
     1
(1 row)