| From: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
|---|---|
| To: | Alexander Rüegg <arueegg(at)uni-bielefeld(dot)de> |
| Cc: | pgsql-general(at)postgresql(dot)org, oleg(at)sai(dot)msu(dot)su |
| Subject: | Re: Tsearch2 lexeme position |
| Date: | 2003-08-13 14:59:54 |
| Message-ID: | 3F3A526A.5080401@sigaev.ru |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Alexander Rüegg wrote:
> Hi,
>
> Is it possible to get all the positions of a lexeme in a result-set of a
> query? For example, we have the table
>
> TEXT TEXT_IDX
> 'TSearch2 is very cool' ...
>
> 'It would be much cooler with lexeme positions'
>
> Our query is
> SELECT text, position FROM thetable WHERE text_idx @@ 'cool'::tsquery;
> ^^^^^^^^
> The result should be something like:
> 'TSearch2 is very cool', 4
> 'It would be much cooler with lexeme positions', 5
>
> If not, is there a function that returns the positions of a lexeme in a
> single entry?
>
You can write such function, but why do you need it? May be there is more simple
way to resolve your problem?
BTW, lexeme can have more that one position...
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jason Priebe | 2003-08-13 15:04:14 | more timeofday() and "set time zone" weirdness |
| Previous Message | Jason Priebe | 2003-08-13 14:43:26 | SET TIME ZONE with GMT+X notation |