mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Fix generation of too long headline with ShortWords.
Per http://archives.postgresql.org/pgsql-hackers/2008-09/msg01088.php
This commit is contained in:
parent
963b87c50b
commit
32cfb33244
@ -301,12 +301,14 @@ prsd_headline(PG_FUNCTION_ARGS)
|
||||
if (curlen < min_words && i >= prs->curwords)
|
||||
{ /* got end of text and our cover is shoter
|
||||
* than min_words */
|
||||
for (i = p; i >= 0; i--)
|
||||
for (i = p - 1 ; i >= 0; i--)
|
||||
{
|
||||
if (!NONWORDTOKEN(prs->words[i].type))
|
||||
curlen++;
|
||||
if (prs->words[i].item && !prs->words[i].repeated)
|
||||
poslen++;
|
||||
if ( curlen >= max_words )
|
||||
break;
|
||||
if (NOENDTOKEN(prs->words[i].type) || prs->words[i].len <= shortword)
|
||||
continue;
|
||||
if (curlen >= min_words)
|
||||
|
Loading…
Reference in New Issue
Block a user