Re: exposing more parse was: Re: tsearch2: setting weights on tsquery - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: exposing more parse was: Re: tsearch2: setting weights on tsquery
Date
Msg-id 20081021160305.6e9679ba@dawn.webthatworks.it
Whole thread Raw
In response to exposing more parse was: Re: tsearch2: setting weights on tsquery  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses Re: exposing more parse was: Re: tsearch2: setting weights on tsquery  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Tue, 21 Oct 2008 13:20:12 +0200
Ivan Sergio Borgonovo <mail@webthatworks.it> wrote:

> On Tue, 21 Oct 2008 10:29:52 +0200
> Ivan Sergio Borgonovo <mail@webthatworks.it> wrote:
>
> I came across this:
> http://grokbase.com/topic/2007/08/07/general-tsearch2-plainto-tsquery-with-or/r92nI5l_k9S4iKcWdCxKs05yFQk

that's the best thing I came up with:

select * from regexp_replace(
strip(
to_tsvector(
'<a:A href="http://www.google.com">pippo</a> pluto gigio'
))::text,
'\'([^\']*)\'','\\1:A','g');

This actually exploit the parser and you can specify the
configuration.

It would still be nice to be able to directly work with tsvector
and tsquery so people could exploit the parser, lexer etc... and
recycle the config.

I'd thinking something in the line of

for lex in select * from to_tsvector('jsjdjd fdsds')

would be nice.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


pgsql-general by date:

Previous
From: "Brandon Metcalf"
Date:
Subject: Re: syncing with a MySQL DB
Next
From: "Sergey Konoplev"
Date:
Subject: Re: index scan leads to result that is different from sec scan after upgrading to 8.3.4