Commit 71e90b0d authored by Tom Lane's avatar Tom Lane

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.
parent e8191d9f
...@@ -479,95 +479,110 @@ SELECT plainto_tsquery('english', 'foo bar') && 'asd | fg'; ...@@ -479,95 +479,110 @@ SELECT plainto_tsquery('english', 'foo bar') && 'asd | fg';
'foo' & 'bar' & ( 'asd' | 'fg' ) 'foo' & 'bar' & ( 'asd' | 'fg' )
(1 row) (1 row)
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years, SELECT ts_rank_cd(to_tsvector('english', '
A thousand years to trace Day after day, day after day,
The granite features of this cliff We stuck, nor breath nor motion,
In crag and scarp and base. As idle as a painted Ship
It took the sea an hour one night Upon a painted Ocean.
An hour of storm to place Water, water, every where
The sculpture of these granite seams, And all the boards did shrink;
Upon a woman s face. E. J. Pratt (1882 1964) Water, water, every where,
'), to_tsquery('english', 'sea&thousand&years')); Nor any drop to drink.
William Wordsworth (1770-1850)
'), to_tsquery('english', 'paint&water'));
ts_rank_cd ts_rank_cd
------------ ------------
0.0555556 0.05
(1 row) (1 row)
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years, SELECT ts_rank_cd(to_tsvector('english', '
A thousand years to trace Day after day, day after day,
The granite features of this cliff We stuck, nor breath nor motion,
In crag and scarp and base. As idle as a painted Ship
It took the sea an hour one night Upon a painted Ocean.
An hour of storm to place Water, water, every where
The sculpture of these granite seams, And all the boards did shrink;
Upon a woman s face. E. J. Pratt (1882 1964) Water, water, every where,
'), to_tsquery('english', 'granite&sea')); Nor any drop to drink.
William Wordsworth (1770-1850)
'), to_tsquery('english', 'breath&motion&water'));
ts_rank_cd ts_rank_cd
------------ ------------
0.0238095 0.00833333
(1 row) (1 row)
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years, SELECT ts_rank_cd(to_tsvector('english', '
A thousand years to trace Day after day, day after day,
The granite features of this cliff We stuck, nor breath nor motion,
In crag and scarp and base. As idle as a painted Ship
It took the sea an hour one night Upon a painted Ocean.
An hour of storm to place Water, water, every where
The sculpture of these granite seams, And all the boards did shrink;
Upon a woman s face. E. J. Pratt (1882 1964) Water, water, every where,
'), to_tsquery('english', 'sea')); Nor any drop to drink.
William Wordsworth (1770-1850)
'), to_tsquery('english', 'ocean'));
ts_rank_cd ts_rank_cd
------------ ------------
0.2 0.1
(1 row) (1 row)
--headline tests --headline tests
SELECT ts_headline('english', 'Erosion It took the sea a thousand years, SELECT ts_headline('english', '
A thousand years to trace Day after day, day after day,
The granite features of this cliff We stuck, nor breath nor motion,
In crag and scarp and base. As idle as a painted Ship
It took the sea an hour one night Upon a painted Ocean.
An hour of storm to place Water, water, every where
The sculpture of these granite seams, And all the boards did shrink;
Upon a woman s face. E. J. Pratt (1882 1964) Water, water, every where,
', to_tsquery('english', 'sea&thousand&years')); Nor any drop to drink.
ts_headline William Wordsworth (1770-1850)
-------------------------------------------- ', to_tsquery('english', 'paint&water'));
<b>sea</b> a <b>thousand</b> <b>years</b>, ts_headline
A <b>thousand</b> <b>years</b> to trace -----------------------------------------
The granite features of this cliff <b>painted</b> Ocean.
(1 row) <b>Water</b>, <b>water</b>, every where
And all the boards did shrink;
SELECT ts_headline('english', 'Erosion It took the sea a thousand years, <b>Water</b>, <b>water</b>, every
A thousand years to trace (1 row)
The granite features of this cliff
In crag and scarp and base. SELECT ts_headline('english', '
It took the sea an hour one night Day after day, day after day,
An hour of storm to place We stuck, nor breath nor motion,
The sculpture of these granite seams, As idle as a painted Ship
Upon a woman s face. E. J. Pratt (1882 1964) Upon a painted Ocean.
', to_tsquery('english', 'granite&sea')); Water, water, every where
ts_headline And all the boards did shrink;
------------------------------------------- Water, water, every where,
<b>sea</b> a thousand years, Nor any drop to drink.
A thousand years to trace William Wordsworth (1770-1850)
The <b>granite</b> features of this cliff ', to_tsquery('english', 'breath&motion&water'));
(1 row) ts_headline
----------------------------------
SELECT ts_headline('english', 'Erosion It took the sea a thousand years, <b>breath</b> nor <b>motion</b>,
A thousand years to trace As idle as a painted Ship
The granite features of this cliff Upon a painted Ocean.
In crag and scarp and base. <b>Water</b>, <b>water</b>
It took the sea an hour one night (1 row)
An hour of storm to place
The sculpture of these granite seams, SELECT ts_headline('english', '
Upon a woman s face. E. J. Pratt (1882 1964) Day after day, day after day,
', to_tsquery('english', 'sea')); We stuck, nor breath nor motion,
ts_headline As idle as a painted Ship
------------------------------------ Upon a painted Ocean.
<b>sea</b> a thousand years, Water, water, every where
A thousand years to trace And all the boards did shrink;
The granite features of this cliff Water, water, every where,
Nor any drop to drink.
William Wordsworth (1770-1850)
', to_tsquery('english', 'ocean'));
ts_headline
----------------------------------
<b>Ocean</b>.
Water, water, every where
And all the boards did shrink;
Water, water, every where
(1 row) (1 row)
SELECT ts_headline('english', ' SELECT ts_headline('english', '
......
...@@ -118,66 +118,78 @@ SELECT plainto_tsquery('english', 'foo bar') || plainto_tsquery('english', 'asd ...@@ -118,66 +118,78 @@ SELECT plainto_tsquery('english', 'foo bar') || plainto_tsquery('english', 'asd
SELECT plainto_tsquery('english', 'foo bar') || !!plainto_tsquery('english', 'asd fg'); SELECT plainto_tsquery('english', 'foo bar') || !!plainto_tsquery('english', 'asd fg');
SELECT plainto_tsquery('english', 'foo bar') && 'asd | fg'; SELECT plainto_tsquery('english', 'foo bar') && 'asd | fg';
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years, SELECT ts_rank_cd(to_tsvector('english', '
A thousand years to trace Day after day, day after day,
The granite features of this cliff We stuck, nor breath nor motion,
In crag and scarp and base. As idle as a painted Ship
It took the sea an hour one night Upon a painted Ocean.
An hour of storm to place Water, water, every where
The sculpture of these granite seams, And all the boards did shrink;
Upon a woman s face. E. J. Pratt (1882 1964) Water, water, every where,
'), to_tsquery('english', 'sea&thousand&years')); Nor any drop to drink.
William Wordsworth (1770-1850)
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years, '), to_tsquery('english', 'paint&water'));
A thousand years to trace
The granite features of this cliff SELECT ts_rank_cd(to_tsvector('english', '
In crag and scarp and base. Day after day, day after day,
It took the sea an hour one night We stuck, nor breath nor motion,
An hour of storm to place As idle as a painted Ship
The sculpture of these granite seams, Upon a painted Ocean.
Upon a woman s face. E. J. Pratt (1882 1964) Water, water, every where
'), to_tsquery('english', 'granite&sea')); And all the boards did shrink;
Water, water, every where,
SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years, Nor any drop to drink.
A thousand years to trace William Wordsworth (1770-1850)
The granite features of this cliff '), to_tsquery('english', 'breath&motion&water'));
In crag and scarp and base.
It took the sea an hour one night SELECT ts_rank_cd(to_tsvector('english', '
An hour of storm to place Day after day, day after day,
The sculpture of these granite seams, We stuck, nor breath nor motion,
Upon a woman s face. E. J. Pratt (1882 1964) As idle as a painted Ship
'), to_tsquery('english', 'sea')); Upon a painted Ocean.
Water, water, every where
And all the boards did shrink;
Water, water, every where,
Nor any drop to drink.
William Wordsworth (1770-1850)
'), to_tsquery('english', 'ocean'));
--headline tests --headline tests
SELECT ts_headline('english', 'Erosion It took the sea a thousand years, SELECT ts_headline('english', '
A thousand years to trace Day after day, day after day,
The granite features of this cliff We stuck, nor breath nor motion,
In crag and scarp and base. As idle as a painted Ship
It took the sea an hour one night Upon a painted Ocean.
An hour of storm to place Water, water, every where
The sculpture of these granite seams, And all the boards did shrink;
Upon a woman s face. E. J. Pratt (1882 1964) Water, water, every where,
', to_tsquery('english', 'sea&thousand&years')); Nor any drop to drink.
William Wordsworth (1770-1850)
SELECT ts_headline('english', 'Erosion It took the sea a thousand years, ', to_tsquery('english', 'paint&water'));
A thousand years to trace
The granite features of this cliff SELECT ts_headline('english', '
In crag and scarp and base. Day after day, day after day,
It took the sea an hour one night We stuck, nor breath nor motion,
An hour of storm to place As idle as a painted Ship
The sculpture of these granite seams, Upon a painted Ocean.
Upon a woman s face. E. J. Pratt (1882 1964) Water, water, every where
', to_tsquery('english', 'granite&sea')); And all the boards did shrink;
Water, water, every where,
SELECT ts_headline('english', 'Erosion It took the sea a thousand years, Nor any drop to drink.
A thousand years to trace William Wordsworth (1770-1850)
The granite features of this cliff ', to_tsquery('english', 'breath&motion&water'));
In crag and scarp and base.
It took the sea an hour one night SELECT ts_headline('english', '
An hour of storm to place Day after day, day after day,
The sculpture of these granite seams, We stuck, nor breath nor motion,
Upon a woman s face. E. J. Pratt (1882 1964) As idle as a painted Ship
', to_tsquery('english', 'sea')); Upon a painted Ocean.
Water, water, every where
And all the boards did shrink;
Water, water, every where,
Nor any drop to drink.
William Wordsworth (1770-1850)
', to_tsquery('english', 'ocean'));
SELECT ts_headline('english', ' SELECT ts_headline('english', '
<html> <html>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment