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

Commite4f8103

Browse files
committed
regression tests: index
1 parentc6e2572 commite4f8103

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

‎src/test/regress/expected/tsearch.out

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,3 +1451,15 @@ select * from pendtest where 'ipi:*'::tsquery @@ ts;
14511451
----
14521452
(0 rows)
14531453

1454+
--check OP_PHRASE on index
1455+
create temp table phrase_index_test(fts tsvector);
1456+
insert into phrase_index_test values('A fat cat has just eaten a rat.');
1457+
create index phrase_index_test_idx on phrase_index_test using gin(fts);
1458+
set enable_seqscan = off;
1459+
select * from phrase_index_test where fts @@ phraseto_tsquery('fat cat');
1460+
fts
1461+
-------------------------------------------------
1462+
'A' 'a' 'cat' 'eaten' 'fat' 'has' 'just' 'rat.'
1463+
(1 row)
1464+
1465+
set enable_seqscan = on;

‎src/test/regress/sql/tsearch.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,3 +479,12 @@ select * from pendtest where 'ipsa:*'::tsquery @@ ts;
479479
select*from pendtestwhere'ips:*'::tsquery @@ ts;
480480
select*from pendtestwhere'ipt:*'::tsquery @@ ts;
481481
select*from pendtestwhere'ipi:*'::tsquery @@ ts;
482+
483+
--check OP_PHRASE on index
484+
create temp table phrase_index_test(fts tsvector);
485+
insert into phrase_index_testvalues('A fat cat has just eaten a rat.');
486+
createindexphrase_index_test_idxon phrase_index_test using gin(fts);
487+
set enable_seqscan= off;
488+
select*from phrase_index_testwhere fts @@ phraseto_tsquery('fat cat');
489+
set enable_seqscan=on;
490+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp