From: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
---|---|
To: | Net Virtual Mailing Lists <mailinglists(at)net-virtual(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: tsearch2 question... |
Date: | 2003-10-20 08:18:13 |
Message-ID: | 3F939A45.4060900@sigaev.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Net Virtual Mailing Lists wrote:
> Hello,
>
> I have a quick question regarding tsearch2, hopefully this is an okay
> place to ask because I couldn't find a tsearch2-specific mailing list..
>
> Anyways, when the field which is indexed using tsearch2 is displayed in
> it's entirety I want the searched keywords to be highlighted, just as in
> a headline except that the entire document gets displayed instead of just
> a summary of it..
>
> In order for this to work well, it would seem that I need the same code
> path as that used to generate the headline to begin with, otherwise
> differences in stemming/etc could cause mis-matches...
>
> My thought was to do:
>
> SELECT bodytext_id,headline(bodytext,
> to_tsquery('default','SEARCH_KEYS'),'
> MaxWords=999999999,MinWords=999999999,ShortWord=0') FROM some_table WHERE
> bodytext_id=SOME_ID
>
> Does this seem like a 'reasonable' way to do this?... In not is there a
> better way that you can think of?...
>
Big value of MinWord is right way.
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
From | Date | Subject | |
---|---|---|---|
Next Message | Ben-Nes Michael | 2003-10-20 08:47:47 | Recomended FS |
Previous Message | Harjo Korte | 2003-10-20 07:38:19 | Re: ecpg and blob's |