Re: Fragments in tsearch2 headline - Mailing list pgsql-general

From Catalin Marinas
Subject Re: Fragments in tsearch2 headline
Date
Msg-id b0943d9e0710311626t2dea3849q286cca7799478e92@mail.gmail.com
Whole thread Raw
In response to Re: Fragments in tsearch2 headline  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: Fragments in tsearch2 headline  ("Sushant Sinha" <sushant354@gmail.com>)
List pgsql-general
On 30/10/2007, Oleg Bartunov <oleg@sai.msu.su> wrote:
> ok, then you have to formalize many things - how long should be excerpts,
> how much excerpts to show, etc. In tsearch2 we have get_covers() function,
> which produces all excerpts like:
>
> =# select get_covers(to_tsvector('1 2 3 4 5 3 4 abc x y z 2 3'), '2&3'::tsquery);
>                     get_covers
> ------------------------------------------------
>   1 {1 2 3 }1 4 5 {2 3 4 abc x y z {3 2 }2 3 }3
> (1 row)

This function generates the lexemes, so cannot be used directly, but
it is probably a good starting point.

> Once you formalize your requirements, you can look on it and adapt to your
> needs (and share with people). I think it could be nice contrib module.

It seems that Sushant already wants to implement this function. He
would probably be faster than me :-) (I'm relatively new to db stuff).
Since I mainly rely on whatever a web hosting company provides, I'll
probably stick with a Python implementation outside the SQL query.

Thanks for your answers.

--
Catalin

pgsql-general by date:

Previous
From: Christian Schröder
Date:
Subject: current_user changes immediately after login
Next
From: Sam Mason
Date:
Subject: Re: Securing stored procedures and triggers