Re: tsearch2 headline options

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Jan Sunavec <jan(dot)sunavec(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2 headline options
Date: 2008-01-04 15:54:32
Message-ID: Pine.LNX.4.64.0801041854050.13244@sn.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2 Jan 2008, Jan Sunavec wrote:

> Hi all
>
> I have following problem when I use this
>
> select headline('asd asd asd asd asd asd asd asd asd asd asd asd more more
> more more more more more', to_tsquery('asd'), '');
>
> I got this
>
> "<b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b>
> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> more more more"
>
> So result is shorted than original text. I tryed set MinWords and MaxWords.
> But it doesn't help me. So question is how can I get original text?

try 'HighlightAll=TRUE

arxiv=# select headline('asd asd asd asd asd asd asd asd asd asd asd asd more more more more more more more', to_tsquery('asd'), 'HighlightAll=TRUE');
headline
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> <b>asd</b> more more more more more more more

>
> Best regards
>
> John
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru)
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2008-01-04 15:58:40 Re: Mandatory AS keyword in SELECT statements
Previous Message Martijn van Oosterhout 2008-01-04 15:52:22 Re: Mandatory AS keyword in SELECT statements