Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0cdc098

Browse files
committed
Merge branch 'CORE-241-rum' of gitlab.postgrespro.ru:pgpro-dev/postgrespro into CORE-241-rum
2 parentsd978c8b +8826de5 commit0cdc098

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

‎expected/rum.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|
1919

2020
explain (costs off)
2121
SELECT * FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|wrote')
22-
ORDER BY a>< to_tsquery('pg_catalog.english', 'ever|wrote');
22+
ORDER BY a<-> to_tsquery('pg_catalog.english', 'ever|wrote');
2323
QUERY PLAN
2424
------------------------------------------------------------------
2525
Sort
26-
Sort Key: ((a>< '''ever'' | ''wrote'''::tsquery))
26+
Sort Key: ((a<-> '''ever'' | ''wrote'''::tsquery))
2727
-> Bitmap Heap Scan on test_rum
2828
Recheck Cond: (a @@ '''ever'' | ''wrote'''::tsquery)
2929
-> Bitmap Index Scan on rumidx
@@ -93,7 +93,7 @@ SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english',
9393
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way')), *
9494
FROM test_rum
9595
WHERE a @@ to_tsquery('pg_catalog.english', 'way')
96-
ORDER BY a>< to_tsquery('pg_catalog.english', 'way');
96+
ORDER BY a<-> to_tsquery('pg_catalog.english', 'way');
9797
rum_ts_distance | t | a
9898
-----------------+--------------------------------------------------------------------------+---------------------------------------------------------------
9999
0.0607927 | my appreciation of you in a more complimentary way than by sending this | 'appreci':2 'complimentari':8 'send':12 'way':9
@@ -105,7 +105,7 @@ SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way')), *
105105
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), *
106106
FROM test_rum
107107
WHERE a @@ to_tsquery('pg_catalog.english', 'way & (go | half)')
108-
ORDER BY a>< to_tsquery('pg_catalog.english', 'way & (go | half)');
108+
ORDER BY a<-> to_tsquery('pg_catalog.english', 'way & (go | half)');
109109
rum_ts_distance | t | a
110110
-----------------+---------------------------------------------------------------------+---------------------------------------------------------
111111
0.103556 | 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

‎rum--1.0.sql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ RETURNS float4
1212
AS'MODULE_PATHNAME'
1313
LANGUAGE C IMMUTABLE STRICT;
1414

15-
CREATE OPERATOR>< (
15+
CREATE OPERATOR<-> (
1616
LEFTARG= tsvector,
1717
RIGHTARG= tsquery,
18-
PROCEDURE= rum_ts_distance,
19-
COMMUTATOR='><'
18+
PROCEDURE= rum_ts_distance
2019
);
2120

2221
CREATEFUNCTIONrum_extract_tsvector(tsvector,internal,internal,internal,internal)
@@ -53,7 +52,7 @@ CREATE OPERATOR CLASS rum_tsvector_ops
5352
FOR TYPE tsvector USING rum
5453
AS
5554
OPERATOR1 @@ (tsvector, tsquery),
56-
OPERATOR2>< (tsvector, tsquery) FORORDER BYpg_catalog.float_ops,
55+
OPERATOR2<-> (tsvector, tsquery) FORORDER BYpg_catalog.float_ops,
5756
FUNCTION1 gin_cmp_tslexeme(text,text),
5857
FUNCTION2 rum_extract_tsvector(tsvector,internal,internal,internal,internal),
5958
FUNCTION3 rum_extract_tsquery(tsquery,internal,smallint,internal,internal,internal,internal),

‎sql/rum.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ explain (costs off)
1616
SELECTcount(*)FROM test_rumWHERE a @@ to_tsquery('pg_catalog.english','ever|wrote');
1717
explain (costs off)
1818
SELECT*FROM test_rumWHERE a @@ to_tsquery('pg_catalog.english','ever|wrote')
19-
ORDER BY a>< to_tsquery('pg_catalog.english','ever|wrote');
19+
ORDER BY a<-> to_tsquery('pg_catalog.english','ever|wrote');
2020
explain (costs off)
2121
SELECTcount(*)FROM test_rumWHERE a @@ to_tsquery('pg_catalog.english',
2222
'def <-> fgr');
@@ -34,11 +34,11 @@ SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english',
3434
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english','way')),*
3535
FROM test_rum
3636
WHERE a @@ to_tsquery('pg_catalog.english','way')
37-
ORDER BY a>< to_tsquery('pg_catalog.english','way');
37+
ORDER BY a<-> to_tsquery('pg_catalog.english','way');
3838
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)')
41-
ORDER BY a>< to_tsquery('pg_catalog.english','way & (go | half)');
41+
ORDER BY a<-> to_tsquery('pg_catalog.english','way & (go | half)');
4242

4343
INSERT INTO test_rum (t)VALUES ('foo bar foo the over foo qq bar');
4444
INSERT INTO test_rum (t)VALUES ('345 qwerty copyright');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp