Skip to content

Commit ea9f27b

Browse files
committed
make sure that <-> and rum_ts_distance actualy the same
1 parent b4b66fc commit ea9f27b

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

expected/rum.out

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,17 @@ SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)'))
112112
10.0905 | 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
113113
(2 rows)
114114

115-
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), *
115+
SELECT
116+
a <-> to_tsquery('pg_catalog.english', 'way & (go | half)'),
117+
rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')),
118+
*
116119
FROM test_rum
117120
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way & (go | half)') limit 3;
118-
rum_ts_distance | t | a
119-
-----------------+-------------------------------------------------------------------------+---------------------------------------------------------
120-
9.65659 | 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
121-
10.0905 | 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
122-
1e+20 | my appreciation of you in a more complimentary way than by sending this | 'appreci':2 'complimentari':8 'send':12 'way':9
121+
?column? | rum_ts_distance | t | a
122+
----------+-----------------+-------------------------------------------------------------------------+---------------------------------------------------------
123+
9.65659 | 9.65659 | 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
124+
10.0905 | 10.0905 | 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
125+
1e+20 | 1e+20 | my appreciation of you in a more complimentary way than by sending this | 'appreci':2 'complimentari':8 'send':12 'way':9
123126
(3 rows)
124127

125128
INSERT INTO test_rum (t) VALUES ('foo bar foo the over foo qq bar');

sql/rum.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)'))
3939
FROM test_rum
4040
WHERE a @@ to_tsquery('pg_catalog.english', 'way & (go | half)')
4141
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way & (go | half)');
42-
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), *
42+
SELECT
43+
a <-> to_tsquery('pg_catalog.english', 'way & (go | half)'),
44+
rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')),
45+
*
4346
FROM test_rum
4447
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way & (go | half)') limit 3;
4548

0 commit comments

Comments
 (0)