@@ -17,6 +17,19 @@ SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|
17
17
Index Cond: (a @@ '''ever'' | ''wrote'''::tsquery)
18
18
(5 rows)
19
19
20
+ explain (costs off)
21
+ SELECT * FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|wrote')
22
+ ORDER BY a >< to_tsquery('pg_catalog.english', 'ever|wrote');
23
+ QUERY PLAN
24
+ ------------------------------------------------------------------
25
+ Sort
26
+ Sort Key: ((a >< '''ever'' | ''wrote'''::tsquery))
27
+ -> Bitmap Heap Scan on test_rum
28
+ Recheck Cond: (a @@ '''ever'' | ''wrote'''::tsquery)
29
+ -> Bitmap Index Scan on rumidx
30
+ Index Cond: (a @@ '''ever'' | ''wrote'''::tsquery)
31
+ (6 rows)
32
+
20
33
SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|wrote');
21
34
count
22
35
-------
@@ -53,6 +66,23 @@ SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', '(comp
53
66
2
54
67
(1 row)
55
68
69
+ SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way')), *
70
+ FROM test_rum
71
+ WHERE a @@ to_tsquery('pg_catalog.english', 'way')
72
+ ORDER BY a >< to_tsquery('pg_catalog.english', 'way');
73
+ rum_ts_distance | t | a
74
+ -----------------+--------------------------------------------------------------------------+---------------------------------------------------------------
75
+ 16.4493 | my appreciation of you in a more complimentary way than by sending this | 'appreci':2 'complimentari':8 'send':12 'way':9
76
+ 16.4493 | itself. Put on your “specs” and look at the castle, half way up the | 'castl':10 'half':11 'look':7 'put':2 'spec':5 'way':12
77
+ 16.4493 | so well that only a fragment, as it were, gave way. It still hangs as if | 'fragment':6 'gave':10 'hang':14 'still':13 'way':11 'well':2
78
+ 16.4493 | thinking--“to go or not to go?” We are this far on the way. Reached | 'far':11 'go':3,7 'reach':15 'think':1 'way':14
79
+ (4 rows)
80
+
81
+ -- CRASHES
82
+ --SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), *
83
+ -- FROM test_rum
84
+ -- WHERE a @@ to_tsquery('pg_catalog.english', 'way & (go | half)')
85
+ -- ORDER BY a >< to_tsquery('pg_catalog.english', 'way & (go | half)');
56
86
INSERT INTO test_rum (t) VALUES ('foo bar foo the over foo qq bar');
57
87
INSERT INTO test_rum (t) VALUES ('345 qwerty copyright');
58
88
INSERT INTO test_rum (t) VALUES ('345 qwerty');
0 commit comments