]> granicus.if.org Git - postgresql/commitdiff
The E. J. Pratt verse used as a tsearch test case is unfortunately still
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 9 Dec 2007 21:01:18 +0000 (21:01 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 9 Dec 2007 21:01:18 +0000 (21:01 +0000)
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.

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

index 50656de9ae93a307c501828a3396fbb07f8c9b62..051b467f64e2b9e82a3e9cf6d08103b662dce738 100644 (file)
@@ -479,95 +479,110 @@ SELECT plainto_tsquery('english', 'foo bar') && 'asd | fg';
  'foo' & 'bar' & ( 'asd' | 'fg' )
 (1 row)
 
-SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-'), to_tsquery('english', 'sea&thousand&years'));
+SELECT ts_rank_cd(to_tsvector('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', 'paint&water'));
  ts_rank_cd 
 ------------
-  0.0555556
-(1 row)
-
-SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-'), to_tsquery('english', 'granite&sea'));
+       0.05
+(1 row)
+
+SELECT ts_rank_cd(to_tsvector('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', 'breath&motion&water'));
  ts_rank_cd 
 ------------
-  0.0238095
-(1 row)
-
-SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-'), to_tsquery('english', 'sea'));
+ 0.00833333
+(1 row)
+
+SELECT ts_rank_cd(to_tsvector('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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'));
  ts_rank_cd 
 ------------
-        0.2
+        0.1
 (1 row)
 
 --headline tests
-SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-', to_tsquery('english', 'sea&thousand&years'));
-                ts_headline                 
---------------------------------------------
- <b>sea</b> a <b>thousand</b> <b>years</b>,
- A <b>thousand</b> <b>years</b> to trace
- The granite features of this cliff
-(1 row)
-
-SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-', to_tsquery('english', 'granite&sea'));
-                ts_headline                
--------------------------------------------
- <b>sea</b> a thousand years,
- A thousand years to trace
- The <b>granite</b> features of this cliff
-(1 row)
-
-SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-', to_tsquery('english', 'sea'));
-            ts_headline             
-------------------------------------
- <b>sea</b> a thousand years,
- A thousand years to trace
- The granite features of this cliff
+SELECT ts_headline('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', 'paint&water'));
+               ts_headline               
+-----------------------------------------
+ <b>painted</b> Ocean.
+ <b>Water</b>, <b>water</b>, every where
+   And all the boards did shrink;
+ <b>Water</b>, <b>water</b>, every
+(1 row)
+
+SELECT ts_headline('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', 'breath&motion&water'));
+           ts_headline            
+----------------------------------
+ <b>breath</b> nor <b>motion</b>,
+ As idle as a painted Ship
+   Upon a painted Ocean.
+ <b>Water</b>, <b>water</b>
+(1 row)
+
+SELECT ts_headline('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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'));
+           ts_headline            
+----------------------------------
+ <b>Ocean</b>.
+ Water, water, every where
+   And all the boards did shrink;
+ Water, water, every where
 (1 row)
 
 SELECT ts_headline('english', '
index 9b37a51391ea93c23919ff673b5bfc1a30d2eb01..0bc919d3ecf56be2165fd177c00d3873960d867f 100644 (file)
@@ -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') && 'asd | fg';
 
-SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-'), to_tsquery('english', 'sea&thousand&years'));
-
-SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-'), to_tsquery('english', 'granite&sea'));
-
-SELECT ts_rank_cd(to_tsvector('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-'), to_tsquery('english', 'sea'));
+SELECT ts_rank_cd(to_tsvector('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', 'paint&water'));
+
+SELECT ts_rank_cd(to_tsvector('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', 'breath&motion&water'));
+
+SELECT ts_rank_cd(to_tsvector('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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
-SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-', to_tsquery('english', 'sea&thousand&years'));
-
-SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-', to_tsquery('english', 'granite&sea'));
-
-SELECT ts_headline('english', 'Erosion It took the sea a thousand years,
-A thousand years to trace
-The granite features of this cliff
-In crag and scarp and base.
-It took the sea an hour one night
-An hour of storm to place
-The sculpture of these granite seams,
-Upon a woman s face. E.  J.  Pratt  (1882 1964)
-', to_tsquery('english', 'sea'));
+SELECT ts_headline('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', 'paint&water'));
+
+SELECT ts_headline('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', 'breath&motion&water'));
+
+SELECT ts_headline('english', '
+Day after day, day after day,
+  We stuck, nor breath nor motion,
+As idle as a painted Ship
+  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', '
 <html>