[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] Fragments in tsearch2 headline
From:       "Catalin Marinas" <catalin.marinas () gmail ! com>
Date:       2007-10-31 23:26:47
Message-ID: b0943d9e0710311626t2dea3849q286cca7799478e92 () mail ! gmail ! com
[Download RAW message or body]

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic