Re: ts_headline

From: Stephen Davies <scldad(at)sdc(dot)com(dot)au>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ts_headline
Date: 2008-02-21 09:46:31
Message-ID: 200802212016.31857.scldad@sdc.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Attached is the "document" in question.

Searches for "norwegian", "thesaurus" and "statement" give good results. A
search for "database" gives the plain text from the beginning.

Cheers and thanks,
Stephen Davies

On Thursday 21 February 2008 20:08, Richard Huxton wrote:
> Stephen Davies wrote:
> > G'day Richard.
> >
> > I don't think so. A sample command is:
> >
> > ts_headline(abstract,to_tsquery('english','database'),'minWords = 99,
> > maxWords = 999')
> >
> > I have also tried with smaller maxwords without any visible effect.
>
> Hmm - a simple test seems to work OK.
>
> SELECT ts_headline( repeat('apple banana carrot ', 100),
> to_tsquery('apple'));
> ts_headline
> ---------------------------------------------------------------------------
>------------------------------------------------------------- <b>apple</b>
> banana carrot <b>apple</b> banana carrot <b>apple</b> banana carrot
> <b>apple</b> banana carrot <b>apple</b> banana carrot (1 row)
>
> It's not just the start of the text either:
>
> SELECT ts_headline( repeat('elephant ', 100) || repeat('apple banana
> carrot ', 100), to_tsquery('apple'));
> ts_headline
> ---------------------------------------------------------------------------
>------------------------------------------------------------- <b>apple</b>
> banana carrot <b>apple</b> banana carrot <b>apple</b> banana carrot
> <b>apple</b> banana carrot <b>apple</b> banana carrot (1 row)
>
> Can you provide a piece of text that shows the problem?

--
========================================================================
This email is for the person(s) identified above, and is confidential to
the sender and the person(s). No one else is authorised to use or
disseminate this email or its contents.

Stephen Davies Consulting Voice: 08-8177 1595
Adelaide, South Australia. Fax: 08-8177 0133
Computing & Network solutions. Mobile:0403 0405 83

Attachment Content-Type Size
q.gz application/x-gzip 5.5 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mario Lopez 2008-02-21 09:56:18 Trigram performance penalty on varchar?
Previous Message Richard Huxton 2008-02-21 09:38:05 Re: ts_headline

Browse pgsql-patches by date

  From Date Subject
Next Message Richard Huxton 2008-02-21 10:20:02 Re: ts_headline
Previous Message Richard Huxton 2008-02-21 09:38:05 Re: ts_headline