Re: tsearch2: word position

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Markus Schiltknecht <markus(at)bluegap(dot)ch>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: tsearch2: word position
Date: 2007-02-21 15:39:31
Message-ID: 45DC67B3.3080608@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I'm fiddling with to_tsvector() and parse() from tsearch2, trying to get
> the word position from those functions. I'd like to use the tsearch2
> parser and stemmer, but I need to know the exact position of the word as
> well as the original, unstemmed word.

It's not supposed usage... Why do you need that?

> And this only tells me a word position, not a character or byte position
> within the string. Is there a way to get this information from tsearch2?

Have a look to headline framework as an example or staring point. hlparsetext()
returns parsed text with matched lexemes in tsquery. Small description of
hlparsetext is placed at
http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/HOWTO-parser-tsearch2.html
near the end. Description of HLWORD struct is some out of day, sorry.

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Markus Schiltknecht 2007-02-21 15:57:03 Re: tsearch2: word position
Previous Message Alvaro Herrera 2007-02-21 15:33:55 Re: REVOKE ALL