Skip to content

Commit e4f8103

Browse files
committed
regression tests: index
1 parent c6e2572 commit e4f8103

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 pendtest where 'ips:*'::tsquery @@ ts;
480480
select * from pendtest where 'ipt:*'::tsquery @@ ts;
481481
select * from pendtest where 'ipi:*'::tsquery @@ ts;
482+
483+
--check OP_PHRASE on index
484+
create temp table phrase_index_test(fts tsvector);
485+
insert into phrase_index_test values('A fat cat has just eaten a rat.');
486+
create index phrase_index_test_idx on phrase_index_test using gin(fts);
487+
set enable_seqscan = off;
488+
select * from phrase_index_test where fts @@ phraseto_tsquery('fat cat');
489+
set enable_seqscan = on;
490+

0 commit comments

Comments
 (0)