Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [GENERAL] Fragments in tsearch2 headline

From: Catalin Marinas <catalin.marinas(at)gmail.com>
Date: Wed Oct 31 2007 - 19:26:47 EDT


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
Received on Wed Oct 31 22:19:06 2007

This archive was generated by hypermail 2.1.8 : Mon Jun 16 2008 - 19:10:58 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library