File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1451,3 +1451,15 @@ select * from pendtest where 'ipi:*'::tsquery @@ ts;
1451
1451
----
1452
1452
(0 rows)
1453
1453
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;
Original file line number Diff line number Diff line change @@ -479,3 +479,12 @@ select * from pendtest where 'ipsa:*'::tsquery @@ ts;
479
479
select * from pendtest where ' ips:*' ::tsquery @@ ts;
480
480
select * from pendtest where ' ipt:*' ::tsquery @@ ts;
481
481
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
+
You can’t perform that action at this time.
0 commit comments