- This function requires positional information in its input.
- Therefore it will not work on stripped> tsvector>
- values — it will always return zero.
+ This function requires lexeme positional information to perform
+ its calculation. Therefore, it ignores any stripped>
+ lexemes in the tsvector>. If there are no unstripped
+ lexemes in the input, the result will be zero. (See
+ linkend="textsearch-manipulate-tsvector"> for more information
+ about the strip> function and positional information
+ in tsvector>s.)
}
else
{
- dimt = POSNULL.npos;
- post = POSNULL.pos;
+ /* ignore words without positions */
+ entry++;
+ continue;
}
while (cur + dimt >= len)
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,
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,