| From: | Richard Huxton <dev(at)archonet(dot)com> |
|---|---|
| To: | Stephen Davies <scldad(at)sdc(dot)com(dot)au> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: ts_headline |
| Date: | 2008-02-21 09:38:05 |
| Message-ID: | 47BD467D.7010407@archonet.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general pgsql-patches |
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?
--
Richard Huxton
Archonet Ltd
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Stephen Davies | 2008-02-21 09:46:31 | Re: ts_headline |
| Previous Message | Stephen Davies | 2008-02-21 09:29:40 | Re: ts_headline |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Stephen Davies | 2008-02-21 09:46:31 | Re: ts_headline |
| Previous Message | Stephen Davies | 2008-02-21 09:29:40 | Re: ts_headline |