Skip to content

Commit 71e90b0

Browse files
committed
The E. J. Pratt verse used as a tsearch test case is unfortunately still
under copyright in the US and many other places. Substitute a little something from a poet who's more safely dead. Per gripe from Bjorn Munch.
1 parent e8191d9 commit 71e90b0

File tree

2 files changed

+165
-138
lines changed

2 files changed

+165
-138
lines changed

src/test/regress/expected/tsearch.out

Lines changed: 95 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -479,95 +479,110 @@ SELECT plainto_tsquery('english', 'foo bar') && 'asd | fg';
479479
'foo' & 'bar' & ( 'asd' | 'fg' )
480480
(1 row)
481481

482-
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
483-
A thousand years to trace
484-
The granite features of this cliff
485-
In crag and scarp and base.
486-
It took the sea an hour one night
487-
An hour of storm to place
488-
The sculpture of these granite seams,
489-
Upon a woman s face. E. J. Pratt (1882 1964)
490-
'), to_tsquery('english', 'sea&thousand&years'));
482+
SELECT ts_rank_cd(to_tsvector('english', '
483+
Day after day, day after day,
484+
We stuck, nor breath nor motion,
485+
As idle as a painted Ship
486+
Upon a painted Ocean.
487+
Water, water, every where
488+
And all the boards did shrink;
489+
Water, water, every where,
490+
Nor any drop to drink.
491+
William Wordsworth (1770-1850)
492+
'), to_tsquery('english', 'paint&water'));
491493
ts_rank_cd
492494
------------
493-
0.0555556
494-
(1 row)
495-
496-
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
497-
A thousand years to trace
498-
The granite features of this cliff
499-
In crag and scarp and base.
500-
It took the sea an hour one night
501-
An hour of storm to place
502-
The sculpture of these granite seams,
503-
Upon a woman s face. E. J. Pratt (1882 1964)
504-
'), to_tsquery('english', 'granite&sea'));
495+
0.05
496+
(1 row)
497+
498+
SELECT ts_rank_cd(to_tsvector('english', '
499+
Day after day, day after day,
500+
We stuck, nor breath nor motion,
501+
As idle as a painted Ship
502+
Upon a painted Ocean.
503+
Water, water, every where
504+
And all the boards did shrink;
505+
Water, water, every where,
506+
Nor any drop to drink.
507+
William Wordsworth (1770-1850)
508+
'), to_tsquery('english', 'breath&motion&water'));
505509
ts_rank_cd
506510
------------
507-
0.0238095
508-
(1 row)
509-
510-
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
511-
A thousand years to trace
512-
The granite features of this cliff
513-
In crag and scarp and base.
514-
It took the sea an hour one night
515-
An hour of storm to place
516-
The sculpture of these granite seams,
517-
Upon a woman s face. E. J. Pratt (1882 1964)
518-
'), to_tsquery('english', 'sea'));
511+
0.00833333
512+
(1 row)
513+
514+
SELECT ts_rank_cd(to_tsvector('english', '
515+
Day after day, day after day,
516+
We stuck, nor breath nor motion,
517+
As idle as a painted Ship
518+
Upon a painted Ocean.
519+
Water, water, every where
520+
And all the boards did shrink;
521+
Water, water, every where,
522+
Nor any drop to drink.
523+
William Wordsworth (1770-1850)
524+
'), to_tsquery('english', 'ocean'));
519525
ts_rank_cd
520526
------------
521-
0.2
527+
0.1
522528
(1 row)
523529

524530
--headline tests
525-
SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
526-
A thousand years to trace
527-
The granite features of this cliff
528-
In crag and scarp and base.
529-
It took the sea an hour one night
530-
An hour of storm to place
531-
The sculpture of these granite seams,
532-
Upon a woman s face. E. J. Pratt (1882 1964)
533-
', to_tsquery('english', 'sea&thousand&years'));
534-
ts_headline
535-
--------------------------------------------
536-
<b>sea</b> a <b>thousand</b> <b>years</b>,
537-
A <b>thousand</b> <b>years</b> to trace
538-
The granite features of this cliff
539-
(1 row)
540-
541-
SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
542-
A thousand years to trace
543-
The granite features of this cliff
544-
In crag and scarp and base.
545-
It took the sea an hour one night
546-
An hour of storm to place
547-
The sculpture of these granite seams,
548-
Upon a woman s face. E. J. Pratt (1882 1964)
549-
', to_tsquery('english', 'granite&sea'));
550-
ts_headline
551-
-------------------------------------------
552-
<b>sea</b> a thousand years,
553-
A thousand years to trace
554-
The <b>granite</b> features of this cliff
555-
(1 row)
556-
557-
SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
558-
A thousand years to trace
559-
The granite features of this cliff
560-
In crag and scarp and base.
561-
It took the sea an hour one night
562-
An hour of storm to place
563-
The sculpture of these granite seams,
564-
Upon a woman s face. E. J. Pratt (1882 1964)
565-
', to_tsquery('english', 'sea'));
566-
ts_headline
567-
------------------------------------
568-
<b>sea</b> a thousand years,
569-
A thousand years to trace
570-
The granite features of this cliff
531+
SELECT ts_headline('english', '
532+
Day after day, day after day,
533+
We stuck, nor breath nor motion,
534+
As idle as a painted Ship
535+
Upon a painted Ocean.
536+
Water, water, every where
537+
And all the boards did shrink;
538+
Water, water, every where,
539+
Nor any drop to drink.
540+
William Wordsworth (1770-1850)
541+
', to_tsquery('english', 'paint&water'));
542+
ts_headline
543+
-----------------------------------------
544+
<b>painted</b> Ocean.
545+
<b>Water</b>, <b>water</b>, every where
546+
And all the boards did shrink;
547+
<b>Water</b>, <b>water</b>, every
548+
(1 row)
549+
550+
SELECT ts_headline('english', '
551+
Day after day, day after day,
552+
We stuck, nor breath nor motion,
553+
As idle as a painted Ship
554+
Upon a painted Ocean.
555+
Water, water, every where
556+
And all the boards did shrink;
557+
Water, water, every where,
558+
Nor any drop to drink.
559+
William Wordsworth (1770-1850)
560+
', to_tsquery('english', 'breath&motion&water'));
561+
ts_headline
562+
----------------------------------
563+
<b>breath</b> nor <b>motion</b>,
564+
As idle as a painted Ship
565+
Upon a painted Ocean.
566+
<b>Water</b>, <b>water</b>
567+
(1 row)
568+
569+
SELECT ts_headline('english', '
570+
Day after day, day after day,
571+
We stuck, nor breath nor motion,
572+
As idle as a painted Ship
573+
Upon a painted Ocean.
574+
Water, water, every where
575+
And all the boards did shrink;
576+
Water, water, every where,
577+
Nor any drop to drink.
578+
William Wordsworth (1770-1850)
579+
', to_tsquery('english', 'ocean'));
580+
ts_headline
581+
----------------------------------
582+
<b>Ocean</b>.
583+
Water, water, every where
584+
And all the boards did shrink;
585+
Water, water, every where
571586
(1 row)
572587

573588
SELECT ts_headline('english', '

src/test/regress/sql/tsearch.sql

Lines changed: 70 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -118,66 +118,78 @@ SELECT plainto_tsquery('english', 'foo bar') || plainto_tsquery('english', 'asd
118118
SELECT plainto_tsquery('english', 'foo bar') || !!plainto_tsquery('english', 'asd fg');
119119
SELECT plainto_tsquery('english', 'foo bar') && 'asd | fg';
120120

121-
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
122-
A thousand years to trace
123-
The granite features of this cliff
124-
In crag and scarp and base.
125-
It took the sea an hour one night
126-
An hour of storm to place
127-
The sculpture of these granite seams,
128-
Upon a woman s face. E. J. Pratt (1882 1964)
129-
'), to_tsquery('english', 'sea&thousand&years'));
130-
131-
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
132-
A thousand years to trace
133-
The granite features of this cliff
134-
In crag and scarp and base.
135-
It took the sea an hour one night
136-
An hour of storm to place
137-
The sculpture of these granite seams,
138-
Upon a woman s face. E. J. Pratt (1882 1964)
139-
'), to_tsquery('english', 'granite&sea'));
140-
141-
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
142-
A thousand years to trace
143-
The granite features of this cliff
144-
In crag and scarp and base.
145-
It took the sea an hour one night
146-
An hour of storm to place
147-
The sculpture of these granite seams,
148-
Upon a woman s face. E. J. Pratt (1882 1964)
149-
'), to_tsquery('english', 'sea'));
121+
SELECT ts_rank_cd(to_tsvector('english', '
122+
Day after day, day after day,
123+
We stuck, nor breath nor motion,
124+
As idle as a painted Ship
125+
Upon a painted Ocean.
126+
Water, water, every where
127+
And all the boards did shrink;
128+
Water, water, every where,
129+
Nor any drop to drink.
130+
William Wordsworth (1770-1850)
131+
'), to_tsquery('english', 'paint&water'));
132+
133+
SELECT ts_rank_cd(to_tsvector('english', '
134+
Day after day, day after day,
135+
We stuck, nor breath nor motion,
136+
As idle as a painted Ship
137+
Upon a painted Ocean.
138+
Water, water, every where
139+
And all the boards did shrink;
140+
Water, water, every where,
141+
Nor any drop to drink.
142+
William Wordsworth (1770-1850)
143+
'), to_tsquery('english', 'breath&motion&water'));
144+
145+
SELECT ts_rank_cd(to_tsvector('english', '
146+
Day after day, day after day,
147+
We stuck, nor breath nor motion,
148+
As idle as a painted Ship
149+
Upon a painted Ocean.
150+
Water, water, every where
151+
And all the boards did shrink;
152+
Water, water, every where,
153+
Nor any drop to drink.
154+
William Wordsworth (1770-1850)
155+
'), to_tsquery('english', 'ocean'));
150156

151157
--headline tests
152-
SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
153-
A thousand years to trace
154-
The granite features of this cliff
155-
In crag and scarp and base.
156-
It took the sea an hour one night
157-
An hour of storm to place
158-
The sculpture of these granite seams,
159-
Upon a woman s face. E. J. Pratt (1882 1964)
160-
', to_tsquery('english', 'sea&thousand&years'));
161-
162-
SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
163-
A thousand years to trace
164-
The granite features of this cliff
165-
In crag and scarp and base.
166-
It took the sea an hour one night
167-
An hour of storm to place
168-
The sculpture of these granite seams,
169-
Upon a woman s face. E. J. Pratt (1882 1964)
170-
', to_tsquery('english', 'granite&sea'));
171-
172-
SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
173-
A thousand years to trace
174-
The granite features of this cliff
175-
In crag and scarp and base.
176-
It took the sea an hour one night
177-
An hour of storm to place
178-
The sculpture of these granite seams,
179-
Upon a woman s face. E. J. Pratt (1882 1964)
180-
', to_tsquery('english', 'sea'));
158+
SELECT ts_headline('english', '
159+
Day after day, day after day,
160+
We stuck, nor breath nor motion,
161+
As idle as a painted Ship
162+
Upon a painted Ocean.
163+
Water, water, every where
164+
And all the boards did shrink;
165+
Water, water, every where,
166+
Nor any drop to drink.
167+
William Wordsworth (1770-1850)
168+
', to_tsquery('english', 'paint&water'));
169+
170+
SELECT ts_headline('english', '
171+
Day after day, day after day,
172+
We stuck, nor breath nor motion,
173+
As idle as a painted Ship
174+
Upon a painted Ocean.
175+
Water, water, every where
176+
And all the boards did shrink;
177+
Water, water, every where,
178+
Nor any drop to drink.
179+
William Wordsworth (1770-1850)
180+
', to_tsquery('english', 'breath&motion&water'));
181+
182+
SELECT ts_headline('english', '
183+
Day after day, day after day,
184+
We stuck, nor breath nor motion,
185+
As idle as a painted Ship
186+
Upon a painted Ocean.
187+
Water, water, every where
188+
And all the boards did shrink;
189+
Water, water, every where,
190+
Nor any drop to drink.
191+
William Wordsworth (1770-1850)
192+
', to_tsquery('english', 'ocean'));
181193

182194
SELECT ts_headline('english', '
183195
<html>

0 commit comments

Comments
 (0)