diff --git a/doc/src/sgml/textsearch.sgml b/doc/src/sgml/textsearch.sgml
new file mode 100644
index 604e545..9e78286
*** a/doc/src/sgml/textsearch.sgml
--- b/doc/src/sgml/textsearch.sgml
*************** SELECT plainto_tsquery('english', 'The F
*** 889,897 ****
         </para>
  
         <para>
!         This function requires positional information in its input.
!         Therefore it will not work on <quote>stripped</> <type>tsvector</>
!         values &mdash; it will always return zero.
         </para>
        </listitem>
       </varlistentry>
--- 889,901 ----
         </para>
  
         <para>
!         This function requires lexeme positional information to perform
!         its calculation.  Therefore, it ignores any <quote>stripped</>
!         lexemes in the <type>tsvector</>.  If there are no unstripped
!         lexemes in the input, the result will be zero.  (See <xref
!         linkend="textsearch-manipulate-tsvector"> for more information
!         about the <function>strip</> function and positional information
!         in <type>tsvector</>s.)
         </para>
        </listitem>
       </varlistentry>
diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c
new file mode 100644
index c9e71c9..dcb681d
*** a/src/backend/utils/adt/tsrank.c
--- b/src/backend/utils/adt/tsrank.c
*************** get_docrep(TSVector txt, QueryRepresenta
*** 658,665 ****
  			}
  			else
  			{
! 				dimt = POSNULL.npos;
! 				post = POSNULL.pos;
  			}
  
  			while (cur + dimt >= len)
--- 658,666 ----
  			}
  			else
  			{
! 				/* ignore words without positions */
! 				entry++;
! 				continue;
  			}
  
  			while (cur + dimt >= len)
diff --git a/src/test/regress/expected/tsearch.out b/src/test/regress/expected/tsearch.out
new file mode 100644
index 9341dbe..d22d345
*** a/src/test/regress/expected/tsearch.out
--- b/src/test/regress/expected/tsearch.out
*************** S. T. Coleridge (1772-1834)
*** 596,601 ****
--- 596,615 ----
          0.1
  (1 row)
  
+ SELECT ts_rank_cd(strip(to_tsvector('both stripped')),
+                   to_tsquery('both & stripped'));
+  ts_rank_cd 
+ ------------
+           0
+ (1 row)
+ 
+ SELECT ts_rank_cd(to_tsvector('unstripped') || strip(to_tsvector('stripped')),
+                   to_tsquery('unstripped & stripped'));
+  ts_rank_cd 
+ ------------
+           0
+ (1 row)
+ 
  --headline tests
  SELECT ts_headline('english', '
  Day after day, day after day,
diff --git a/src/test/regress/sql/tsearch.sql b/src/test/regress/sql/tsearch.sql
new file mode 100644
index 9fd1207..fa460cd
*** a/src/test/regress/sql/tsearch.sql
--- b/src/test/regress/sql/tsearch.sql
*************** Water, water, every where,
*** 165,170 ****
--- 165,176 ----
  S. T. Coleridge (1772-1834)
  '), to_tsquery('english', 'ocean'));
  
+ SELECT ts_rank_cd(strip(to_tsvector('both stripped')),
+                   to_tsquery('both & stripped'));
+ 
+ SELECT ts_rank_cd(to_tsvector('unstripped') || strip(to_tsvector('stripped')),
+                   to_tsquery('unstripped & stripped'));
+ 
  --headline tests
  SELECT ts_headline('english', '
  Day after day, day after day,
